summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz93@gmail.com>2018-04-09 13:48:53 -0400
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2018-04-09 10:48:53 -0700
commitdaeb8013b20f9c47e85730faaa4131064a1f9c2e (patch)
tree4dd2930e68497c4111f5440b2a32751fb871e317 /CMakeLists.txt
parent341cea5a325bb6d0548a3cb4189362b34cf1caf4 (diff)
cmake: always install the pkg-config file (#193)
There's really never a reason to *not* want this installed. If an option is needed to specify installing in a versioned subdirectory, this option should be explicitly described rather than hidden in something else. As an added bonus, this makes the CMake install code slightly *less* complicated.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt10
1 files changed, 4 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 90fa679..d7bc1b2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,7 +4,7 @@ project(pugixml)
option(BUILD_SHARED_LIBS "Build shared instead of static library" OFF)
option(BUILD_TESTS "Build tests" OFF)
-option(BUILD_PKGCONFIG "Build in PKGCONFIG mode" OFF)
+option(USE_VERSIONED_LIBDIR "Use a private subdirectory to install the headers and libs" OFF)
set(BUILD_DEFINES "" CACHE STRING "Build defines")
@@ -55,7 +55,7 @@ endif()
set_target_properties(pugixml PROPERTIES VERSION 1.9 SOVERSION 1)
get_target_property(PUGIXML_VERSION_STRING pugixml VERSION)
-if(BUILD_PKGCONFIG)
+if(USE_VERSIONED_LIBDIR)
# Install library into its own directory under LIBDIR
set(INSTALL_SUFFIX /pugixml-${PUGIXML_VERSION_STRING})
endif()
@@ -71,10 +71,8 @@ install(TARGETS pugixml EXPORT pugixml-config
install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}${INSTALL_SUFFIX})
install(EXPORT pugixml-config DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/pugixml)
-if(BUILD_PKGCONFIG)
- configure_file(scripts/pugixml.pc.in ${PROJECT_BINARY_DIR}/pugixml.pc @ONLY)
- install(FILES ${PROJECT_BINARY_DIR}/pugixml.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
-endif()
+configure_file(scripts/pugixml.pc.in ${PROJECT_BINARY_DIR}/pugixml.pc @ONLY)
+install(FILES ${PROJECT_BINARY_DIR}/pugixml.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
if(BUILD_TESTS)
file(GLOB TEST_SOURCES tests/*.cpp)