summaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-10-10 12:50:42 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2017-10-10 12:50:42 -0700
commitafc9a17d359b25b8636ffa535ffe2a1cb1fbba01 (patch)
treec093d75d086c5ba2b48aaac86c8d2b2045c3c957 /src/CMakeLists.txt
parentec9db9166f0a931ed2990e531f8e618669b7f8f1 (diff)
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.
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt10
1 files changed, 6 insertions, 4 deletions
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