summaryrefslogtreecommitdiffstats
path: root/Help/command
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2024-09-17 22:45:01 (GMT)
committerCraig Scott <craig.scott@crascit.com>2024-09-19 10:31:47 (GMT)
commit6a1fac14505619dfea26ca6a3020eb0b6b409557 (patch)
tree52fddb6d738997dfef88c4172f15d9e1206ee031 /Help/command
parent2184fcfb006691a6ecf79762b4ce3c6b93266ab6 (diff)
downloadCMake-6a1fac14505619dfea26ca6a3020eb0b6b409557.zip
CMake-6a1fac14505619dfea26ca6a3020eb0b6b409557.tar.gz
CMake-6a1fac14505619dfea26ca6a3020eb0b6b409557.tar.bz2
install: Normalize DESTINATION paths
The file generated by install(EXPORT) computes _IMPORT_PREFIX in a way that assumes a normalized path. If the DESTINATION contains any ../ components, the computed _IMPORT_PREFIX would be wrong. Force the DESTINATION path to be normalized, subject to the new CMP0176 policy. Also normalize all other DESTINATION paths for consistency, except for INCLUDES DESTINATION, which is not strictly a destination but rather a search path to add. Fixes: #26252
Diffstat (limited to 'Help/command')
-rw-r--r--Help/command/install.rst14
1 files changed, 13 insertions, 1 deletions
diff --git a/Help/command/install.rst b/Help/command/install.rst
index b199147..f7171a4 100644
--- a/Help/command/install.rst
+++ b/Help/command/install.rst
@@ -58,7 +58,7 @@ signatures that specify them. The common options are:
``<dir>`` should be a relative path. An absolute path is allowed,
but not recommended.
- When a relative path is given it is interpreted relative to the value
+ When a relative path is given, it is interpreted relative to the value
of the :variable:`CMAKE_INSTALL_PREFIX` variable.
The prefix can be relocated at install time using the ``DESTDIR``
mechanism explained in the :variable:`CMAKE_INSTALL_PREFIX` variable
@@ -75,6 +75,11 @@ signatures that specify them. The common options are:
If an absolute path (with a leading slash or drive letter) is given
it is used verbatim.
+ .. versionchanged:: 3.31
+ ``<dir>`` will be normalized according to the same
+ :ref:`normalization rules <Normalization>` as the
+ :command:`cmake_path` command.
+
``PERMISSIONS <permission>...``
Specify permissions for installed files. Valid permissions are
``OWNER_READ``, ``OWNER_WRITE``, ``OWNER_EXECUTE``, ``GROUP_READ``,
@@ -396,6 +401,12 @@ Signatures
If a relative path is specified, it is treated as relative to the
:genex:`$<INSTALL_PREFIX>`.
+ Unlike other ``DESTINATION`` arguments for the various ``install()``
+ subcommands, paths given after ``INCLUDES DESTINATION`` are used as
+ given. They are not normalized, nor assumed to be normalized, although
+ it is recommended that they are given in normalized form (see
+ :ref:`Normalization`).
+
``RUNTIME_DEPENDENCY_SET <set-name>``
.. versionadded:: 3.21
@@ -807,6 +818,7 @@ Signatures
the generated file will be called ``<export-name>.cmake`` but the ``FILE``
option may be used to specify a different name. The value given to
the ``FILE`` option must be a file name with the ``.cmake`` extension.
+
If a ``CONFIGURATIONS`` option is given then the file will only be installed
when one of the named configurations is installed. Additionally, the
generated import file will reference only the matching target