summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-01-24 14:20:34 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-01-24 14:20:49 (GMT)
commit62483b9b99647bcec8275d7b139a64e879623fcc (patch)
tree029af6e5911ddbd1a547b26d398125d67c476673
parent7c241bccc305d1ffa62e143eb9e795d10091978c (diff)
parentbfa61ccf64db099f182da72854835a3a6263b981 (diff)
downloadCMake-62483b9b99647bcec8275d7b139a64e879623fcc.zip
CMake-62483b9b99647bcec8275d7b139a64e879623fcc.tar.gz
CMake-62483b9b99647bcec8275d7b139a64e879623fcc.tar.bz2
Merge topic 'gen-pkg-example'
bfa61ccf64 Help: Modernize PackageConfigHelpers example Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8111
-rw-r--r--Modules/CMakePackageConfigHelpers.cmake12
1 files changed, 7 insertions, 5 deletions
diff --git a/Modules/CMakePackageConfigHelpers.cmake b/Modules/CMakePackageConfigHelpers.cmake
index 6f5702a..1dc850a 100644
--- a/Modules/CMakePackageConfigHelpers.cmake
+++ b/Modules/CMakePackageConfigHelpers.cmake
@@ -200,14 +200,16 @@ Example using both :command:`configure_package_config_file` and
.. code-block:: cmake
- set(INCLUDE_INSTALL_DIR include/ ... CACHE )
- set(LIB_INSTALL_DIR lib/ ... CACHE )
- set(SYSCONFIG_INSTALL_DIR etc/foo/ ... CACHE )
+ include(GNUInstallDirs)
+ set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}/Foo
+ CACHE PATH "Location of header files" )
+ set(SYSCONFIG_INSTALL_DIR ${CMAKE_INSTALL_SYSCONFDIR}/foo
+ CACHE PATH "Location of configuration files" )
#...
include(CMakePackageConfigHelpers)
configure_package_config_file(FooConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake
- INSTALL_DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake
+ INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Foo
PATH_VARS INCLUDE_INSTALL_DIR SYSCONFIG_INSTALL_DIR)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
@@ -215,7 +217,7 @@ Example using both :command:`configure_package_config_file` and
COMPATIBILITY SameMajorVersion )
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
- DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake )
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Foo )
``FooConfig.cmake.in``: