1
0
mirror of https://github.com/leethomason/tinyxml2.git synced 2026-07-21 19:23:00 +04:00

Merge pull request #1004 from bebuch/master

add CMake option to disable PkgConfig install
This commit is contained in:
Lee Thomason
2024-12-04 17:46:06 -08:00
committed by GitHub
+12 -8
View File
@@ -63,7 +63,9 @@ endif ()
include(GNUInstallDirs) include(GNUInstallDirs)
include(CMakePackageConfigHelpers) include(CMakePackageConfigHelpers)
## Custom locations ## Custom settings
option(tinyxml2_INSTALL_PKGCONFIG "Create and install pkgconfig files" ON)
set(tinyxml2_INSTALL_PKGCONFIGDIR "${CMAKE_INSTALL_LIBDIR}/pkgconfig" set(tinyxml2_INSTALL_PKGCONFIGDIR "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
CACHE PATH "Directory for pkgconfig files") CACHE PATH "Directory for pkgconfig files")
@@ -121,10 +123,12 @@ install(
## pkg-config ## pkg-config
configure_file(cmake/tinyxml2.pc.in tinyxml2.pc.gen @ONLY) if (tinyxml2_INSTALL_PKGCONFIG)
file(GENERATE OUTPUT tinyxml2.pc INPUT "${CMAKE_CURRENT_BINARY_DIR}/tinyxml2.pc.gen") configure_file(cmake/tinyxml2.pc.in tinyxml2.pc.gen @ONLY)
install( file(GENERATE OUTPUT tinyxml2.pc INPUT "${CMAKE_CURRENT_BINARY_DIR}/tinyxml2.pc.gen")
FILES "${CMAKE_CURRENT_BINARY_DIR}/tinyxml2.pc" install(
DESTINATION "${tinyxml2_INSTALL_PKGCONFIGDIR}" FILES "${CMAKE_CURRENT_BINARY_DIR}/tinyxml2.pc"
COMPONENT tinyxml2_development DESTINATION "${tinyxml2_INSTALL_PKGCONFIGDIR}"
) COMPONENT tinyxml2_development
)
endif ()