From afc9a17d359b25b8636ffa535ffe2a1cb1fbba01 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 10 Oct 2017 12:50:42 -0700 Subject: Don't use CMAKE_INSTALL_LIBDIR to create libcmark.pc. For some reason this wasn't getting set in processing libcmark.pc.in, and we were getting the wrong entry in libcmark.pc. (See #236) The new approach sets an internal libdir variable to lib${LIB_SUFFIX}. This variable is used both to set the install destination and in the libcmark.pc.in template. Closes #236. However, I'd welcome comments from @juhp who originally added CMAKE_INSTALL_LIBDIR in #185. I think that the new system should work fine with Fedora, since LIB_SUFFIX will be set appropriately, but some testing is in order. --- src/CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/CMakeLists.txt') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3197196..87832dc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -123,19 +123,21 @@ endif(MSVC) set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON) +set(libdir lib${LIB_SUFFIX}) + include (InstallRequiredSystemLibraries) install(TARGETS ${PROGRAM} ${CMARK_INSTALL} EXPORT cmark RUNTIME DESTINATION bin - LIBRARY DESTINATION lib${LIB_SUFFIX} - ARCHIVE DESTINATION lib${LIB_SUFFIX} + LIBRARY DESTINATION ${libdir} + ARCHIVE DESTINATION include ) if(CMARK_SHARED OR CMARK_STATIC) 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${LIB_SUFFIX}/pkgconfig) + DESTINATION ${libdir}/pkgconfig) install(FILES cmark.h @@ -144,7 +146,7 @@ if(CMARK_SHARED OR CMARK_STATIC) DESTINATION include ) - install(EXPORT cmark DESTINATION lib${LIB_SUFFIX}/cmake) + install(EXPORT cmark DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) endif() # Feature tests -- cgit v1.2.3 From a54e12c9e5da809b425cc0f2c01d30953f4ab512 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 12 Oct 2017 07:57:54 -0700 Subject: Fixed regression in install dest for static library. Due to a mistake, 0.28.1 installed libcmark.a into include/. Closes #238. --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/CMakeLists.txt') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 87832dc..148cf78 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -130,7 +130,7 @@ install(TARGETS ${PROGRAM} ${CMARK_INSTALL} EXPORT cmark RUNTIME DESTINATION bin LIBRARY DESTINATION ${libdir} - ARCHIVE DESTINATION include + ARCHIVE DESTINATION ${libdir} ) if(CMARK_SHARED OR CMARK_STATIC) -- cgit v1.2.3 From 4f98864eb2781a8635e94d98f550100b1fa4add2 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Thu, 19 Oct 2017 14:20:26 +0200 Subject: Include GNUInstallDirs in src/CMakeLists.txt Fixes installation error under some CMake versions, notably kalakris' CMake backport often used with Travis. --- src/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/CMakeLists.txt') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 148cf78..d5a1936 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,6 +2,8 @@ if(${CMAKE_VERSION} VERSION_GREATER "3.3") cmake_policy(SET CMP0063 NEW) endif() +include(GNUInstallDirs) + set(LIBRARY "libcmark") set(STATICLIBRARY "libcmark_static") set(HEADERS -- cgit v1.2.3