summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-12-28 00:01:09 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-12-28 00:01:09 -0800
commit9a0fa00037414323683625b65ec600aa711a9b12 (patch)
treef167ca8cc4cceb4b40f5f3c6da8419054bcdac55 /src
parent8ba264584bafaf1ee3592c338d4db91e591bdfb0 (diff)
Make LIB_INSTALL_DIR configurable.
Closes #79. Thanks to Mathieu Bridon for the patch.
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 02918f5..386bfe8 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -46,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
@@ -54,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)
@@ -118,8 +127,8 @@ set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
include (InstallRequiredSystemLibraries)
install(TARGETS ${PROGRAM} ${LIBRARY} ${STATICLIBRARY}
RUNTIME DESTINATION bin
- LIBRARY DESTINATION lib
- ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION ${LIB_INSTALL_DIR}
+ ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
)
install(FILES