diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2016-09-20 22:16:47 -0700 |
---|---|---|
committer | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2016-09-20 22:16:47 -0700 |
commit | 2933a03d09808961da4b0209325b69eb1eeb7703 (patch) | |
tree | 65be4df94c3f2381ca5d57df6ce0379ef20156e4 | |
parent | fd896d2476e087090196287cba64843db87533e5 (diff) |
CMake: Simplify install path logic
Select correct suffix to use for pkg-config
-rw-r--r-- | CMakeLists.txt | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a843989..3dbdd6f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,27 +51,15 @@ set_target_properties(pugixml PROPERTIES VERSION 1.7 SOVERSION 1) get_target_property(PUGIXML_VERSION_STRING pugixml VERSION) if(BUILD_PKGCONFIG) - # Install shared library into its own directory under LIBDIR - install(TARGETS pugixml EXPORT pugixml-config - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/pugixml-${PUGIXML_VERSION_STRING} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/pugixml-${PUGIXML_VERSION_STRING} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ) - - # Install header files into their own directory under INCLUDEDIR - install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pugixml-${PUGIXML_VERSION_STRING}) -else() - # Install shared library into default LIBDIR directory - install(TARGETS pugixml EXPORT pugixml-config - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ) - - # Install header files into default INCLUDEDIR directory - install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + # Install library into its own directory under LIBDIR + set(INSTALL_SUFFIX /pugixml-${PUGIXML_VERSION_STRING}) endif() +install(TARGETS pugixml EXPORT pugixml-config + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${INSTALL_SUFFIX} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${INSTALL_SUFFIX} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}${INSTALL_SUFFIX}) install(EXPORT pugixml-config DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/pugixml) if(BUILD_PKGCONFIG) |