Merge topic 'file-REAL_PATH-relative'

6b5f2dbbfe file(REAL_PATH): resolve symlinks before '..' components

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8605
This commit is contained in:
Brad King
2023-07-24 12:43:15 +00:00
committed by Kitware Robot
17 changed files with 188 additions and 9 deletions
+5
View File
@@ -981,6 +981,11 @@ Path Conversion
if ``USERPROFILE`` is not defined. On all other platforms, only ``HOME``
is used.
.. versionchanged:: 3.28
All symlinks are resolved before collapsing ``../`` components.
See policy :policy:`CMP0152`.
.. signature::
file(RELATIVE_PATH <variable> <directory> <file>)
+8
View File
@@ -51,6 +51,14 @@ The :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` variable may also be used
to determine whether to report an error on use of deprecated macros or
functions.
Policies Introduced by CMake 3.28
=================================
.. toctree::
:maxdepth: 1
CMP0152: file(REAL_PATH) resolves symlinks before collapsing ../ components. </policy/CMP0152>
Policies Introduced by CMake 3.27
=================================
+20
View File
@@ -0,0 +1,20 @@
CMP0152
-------
.. versionadded:: 3.28
:command:`file(REAL_PATH)` resolves symlinks before collapsing ../ components.
In CMake 3.27 and below, :command:`file(REAL_PATH)` collapsed any ``../``
components in a path before resolving symlinks. This produced incorrect
results when the ``../`` collapsed away a symlink.
The ``OLD`` behavior for this policy is to collapse ``../`` components before
resolving symlinks.
The ``NEW`` behavior for this policy is to resolve all symlinks before
collapsing ``../`` components.
This policy was introduced in CMake version 3.28. Use the
:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
.. include:: DEPRECATED.txt