diff options
author | Azamat H. Hackimov <azamat.hackimov@gmail.com> | 2017-01-05 00:38:28 +0500 |
---|---|---|
committer | Azamat H. Hackimov <azamat.hackimov@gmail.com> | 2017-01-06 17:10:09 +0500 |
commit | 7031efcb5fc577dc70f3188ce1c46bf894b1e48a (patch) | |
tree | 5391598f06166d15a91afdd011aced6ed009f882 /src | |
parent | a8d5bd452ae8a7b2d3285a85a9117f95ed1732cc (diff) |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 17 |
1 files changed, 4 insertions, 13 deletions
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) |