From 7031efcb5fc577dc70f3188ce1c46bf894b1e48a Mon Sep 17 00:00:00 2001 From: "Azamat H. Hackimov" Date: Thu, 5 Jan 2017 00:38:28 +0500 Subject: Added support for built-in ${LIB_SUFFIX} feature Replaced ${LIB_INSTALL_DIR} option with built-in ${LIB_SUFFIX} for installing for 32/64-bit systems. Normally, CMake will set ${LIB_SUFFIX} automatically for required enviroment. If you have any issues with it, you can override this option with -DLIB_SUFFIX=64 or -DLIB_SUFFIX="" during configuration. --- src/CMakeLists.txt | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0cb6530..2a4dc9f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -49,15 +49,6 @@ 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 @@ -66,7 +57,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_INSTALL_DIR}/pkgconfig) + DESTINATION lib${LIB_SUFFIX}/pkgconfig) include (GenerateExportHeader) @@ -131,8 +122,8 @@ include (InstallRequiredSystemLibraries) install(TARGETS ${PROGRAM} ${LIBRARY} ${STATICLIBRARY} EXPORT cmark RUNTIME DESTINATION bin - LIBRARY DESTINATION ${LIB_INSTALL_DIR} - ARCHIVE DESTINATION ${LIB_INSTALL_DIR} + LIBRARY DESTINATION lib${LIB_SUFFIX} + ARCHIVE DESTINATION lib${LIB_SUFFIX} ) install(FILES @@ -142,7 +133,7 @@ install(FILES DESTINATION include ) -install(EXPORT cmark DESTINATION ${LIB_INSTALL_DIR}/cmake) +install(EXPORT cmark DESTINATION lib${LIB_SUFFIX}/cmake) # Feature tests include(CheckIncludeFile) -- cgit v1.2.3