summaryrefslogtreecommitdiffstats
path: root/Help/policy
diff options
context:
space:
mode:
authorRobert Maynard <rmaynard@nvidia.com>2023-06-29 19:24:49 (GMT)
committerRobert Maynard <rmaynard@nvidia.com>2023-07-20 21:02:58 (GMT)
commit6b5f2dbbfe453f9bafe46ee420e657735ff16fb0 (patch)
treea27c2718ea6c2ddd76e75b35eb035cfc48a0b358 /Help/policy
parentb0054dd65c1d69a437abe85d27e704326884a9c2 (diff)
downloadCMake-6b5f2dbbfe453f9bafe46ee420e657735ff16fb0.zip
CMake-6b5f2dbbfe453f9bafe46ee420e657735ff16fb0.tar.gz
CMake-6b5f2dbbfe453f9bafe46ee420e657735ff16fb0.tar.bz2
file(REAL_PATH): resolve symlinks before '..' components
Previously REAL_PATH would collapse paths before resolving any symlinks so if `..` crossed a symlink the output from `REAL_PATH` would be wrong. It looked like REAL_PATH did this by mistake since it was a side-effect of ensuring we had an absolute path before resolving symlinks.
Diffstat (limited to 'Help/policy')
-rw-r--r--Help/policy/CMP0152.rst20
1 files changed, 20 insertions, 0 deletions
diff --git a/Help/policy/CMP0152.rst b/Help/policy/CMP0152.rst
new file mode 100644
index 0000000..d7e8692
--- /dev/null
+++ b/Help/policy/CMP0152.rst
@@ -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