From 9a0fa00037414323683625b65ec600aa711a9b12 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 28 Dec 2015 00:01:09 -0800 Subject: Make LIB_INSTALL_DIR configurable. Closes #79. Thanks to Mathieu Bridon for the patch. --- src/CMakeLists.txt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/CMakeLists.txt') 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 -- cgit v1.2.3