Skip to content

Commit

Permalink
Merge pull request #1004 from bebuch/master
Browse files Browse the repository at this point in the history
add CMake option to disable PkgConfig install
  • Loading branch information
leethomason authored Dec 5, 2024
2 parents 601a953 + 20ecbb2 commit d13a151
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ endif ()
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)

## Custom locations
## Custom settings
option(tinyxml2_INSTALL_PKGCONFIG "Create and install pkgconfig files" ON)

set(tinyxml2_INSTALL_PKGCONFIGDIR "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
CACHE PATH "Directory for pkgconfig files")

Expand Down Expand Up @@ -121,10 +123,12 @@ install(

## pkg-config

configure_file(cmake/tinyxml2.pc.in tinyxml2.pc.gen @ONLY)
file(GENERATE OUTPUT tinyxml2.pc INPUT "${CMAKE_CURRENT_BINARY_DIR}/tinyxml2.pc.gen")
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/tinyxml2.pc"
DESTINATION "${tinyxml2_INSTALL_PKGCONFIGDIR}"
COMPONENT tinyxml2_development
)
if (tinyxml2_INSTALL_PKGCONFIG)
configure_file(cmake/tinyxml2.pc.in tinyxml2.pc.gen @ONLY)
file(GENERATE OUTPUT tinyxml2.pc INPUT "${CMAKE_CURRENT_BINARY_DIR}/tinyxml2.pc.gen")
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/tinyxml2.pc"
DESTINATION "${tinyxml2_INSTALL_PKGCONFIGDIR}"
COMPONENT tinyxml2_development
)
endif ()

0 comments on commit d13a151

Please sign in to comment.