diff options
author | Brad King <brad.king@kitware.com> | 2024-02-16 15:08:03 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2024-02-16 15:08:18 (GMT) |
commit | 559231aec30e8c246e5f03fb0cacc9026661cb0c (patch) | |
tree | 177c72aa913c610a021edd398b04e2fe80f7c191 /Modules | |
parent | 4398b60ac642a663c46226162d039db539c10494 (diff) | |
parent | af293ff7c3847dae029d5e91a3ea1864466c9659 (diff) | |
download | CMake-559231aec30e8c246e5f03fb0cacc9026661cb0c.zip CMake-559231aec30e8c246e5f03fb0cacc9026661cb0c.tar.gz CMake-559231aec30e8c246e5f03fb0cacc9026661cb0c.tar.bz2 |
Merge topic 'doc-install-relative-paths' into release-3.29
af293ff7c3 Help: Explicitly discourage absolute install destinations
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9261
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/GNUInstallDirs.cmake | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/Modules/GNUInstallDirs.cmake b/Modules/GNUInstallDirs.cmake index 9796854..ed34c4a 100644 --- a/Modules/GNUInstallDirs.cmake +++ b/Modules/GNUInstallDirs.cmake @@ -20,11 +20,16 @@ Inclusion of this module defines the following variables: ``CMAKE_INSTALL_<dir>`` Destination for files of a given type. This value may be passed to - the ``DESTINATION`` options of :command:`install` commands for the - corresponding file type. It should typically be a path relative to - the installation prefix so that it can be converted to an absolute - path in a relocatable way (see ``CMAKE_INSTALL_FULL_<dir>``). - However, an absolute path is also allowed. + the ``DESTINATION`` options of :command:`install` commands for the + corresponding file type. It should be a path relative to the installation + prefix so that it can be converted to an absolute path in a relocatable way. + + While absolute paths are allowed, they are not recommended as they + do not work with the ``cmake --install`` command's + :option:`--prefix <cmake--install --prefix>` option, or with the + :manual:`cpack <cpack(1)>` installer generators. In particular, there is no + need to make paths absolute by prepending :variable:`CMAKE_INSTALL_PREFIX`; + this prefix is used by default if the DESTINATION is a relative path. ``CMAKE_INSTALL_FULL_<dir>`` @@ -34,6 +39,11 @@ Inclusion of this module defines the following variables: :variable:`CMAKE_INSTALL_PREFIX` variable. However, there are some `special cases`_ as documented below. + These variables shouldn't be used in :command:`install` commands + as they do not work with the ``cmake --install`` command's + :option:`--prefix <cmake--install --prefix>` option, or with the + :manual:`cpack <cpack(1)>` installer generators. + where ``<dir>`` is one of: ``BINDIR`` |