summaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f619453..386bfe8 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -9,7 +9,6 @@ set(HEADERS
iterator.h
chunk.h
references.h
- bench.h
utf8.h
scanners.h
inlines.h
@@ -47,6 +46,15 @@ set(PROGRAM_SOURCES
main.c
)
+# We make LIB_INSTALL_DIR configurable rather than
+# hard-coding lib, because on some OSes different locations
+# are used for different architectures (e.g. /usr/lib64 on
+# 64-bit Fedora).
+if(NOT LIB_INSTALL_DIR)
+ set(LIB_INSTALL_DIR "lib" CACHE STRING
+ "Set the installation directory for libraries." FORCE)
+endif(NOT LIB_INSTALL_DIR)
+
include_directories(. ${CMAKE_CURRENT_BINARY_DIR})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmark_version.h.in
@@ -55,7 +63,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmark_version.h.in
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libcmark.pc.in
${CMAKE_CURRENT_BINARY_DIR}/libcmark.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libcmark.pc
- DESTINATION lib/pkgconfig)
+ DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
include (GenerateExportHeader)
@@ -117,9 +125,10 @@ endif(MSVC)
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
include (InstallRequiredSystemLibraries)
-install(TARGETS ${PROGRAM} ${LIBRARY}
+install(TARGETS ${PROGRAM} ${LIBRARY} ${STATICLIBRARY}
RUNTIME DESTINATION bin
- LIBRARY DESTINATION lib
+ LIBRARY DESTINATION ${LIB_INSTALL_DIR}
+ ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
)
install(FILES
@@ -165,10 +174,6 @@ if(MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /TP")
endif()
-if($ENV{TIMER})
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTIMER=1")
-endif($ENV{TIMER})
-
if(CMAKE_BUILD_TYPE STREQUAL "Ubsan")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined")
endif()