summaryrefslogtreecommitdiffstats
path: root/Help/policy
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2021-07-17 06:43:12 (GMT)
committerCraig Scott <craig.scott@crascit.com>2021-07-17 06:43:25 (GMT)
commit6d5f74fcd7dd6c6490667f92382d7fda27ce9b3e (patch)
tree003900fbe8e1b1b84b45e80028c1ca84b45c85a0 /Help/policy
parent7c6234dd21b7af95e7edea6b281d859dafb2ae81 (diff)
downloadCMake-6d5f74fcd7dd6c6490667f92382d7fda27ce9b3e.zip
CMake-6d5f74fcd7dd6c6490667f92382d7fda27ce9b3e.tar.gz
CMake-6d5f74fcd7dd6c6490667f92382d7fda27ce9b3e.tar.bz2
Help: Clarify wording of CMP0124
Diffstat (limited to 'Help/policy')
-rw-r--r--Help/policy/CMP0124.rst12
1 files changed, 5 insertions, 7 deletions
diff --git a/Help/policy/CMP0124.rst b/Help/policy/CMP0124.rst
index 88d03e3..3935166 100644
--- a/Help/policy/CMP0124.rst
+++ b/Help/policy/CMP0124.rst
@@ -3,14 +3,12 @@ CMP0124
.. versionadded:: 3.21
-The loop variables created by :command:`foreach` command have now their scope
-restricted to the loop scope.
+When this policy is set to ``NEW``, the scope of loop variables defined by the
+:command:`foreach` command is restricted to the loop only. They will be unset
+at the end of the loop.
-Starting with CMake 3.21, the :command:`foreach` command ensures that the loop
-variables have their scope restricted to the loop scope.
-
-The ``OLD`` behavior for this policy let the loop variables to exist, with an
-empty value, in the outer scope of loop scope.
+The ``OLD`` behavior for this policy still clears the loop variables at the end
+of the loop, but does not unset them. This leaves them as defined, but empty.
This policy was introduced in CMake version 3.21. Use the
:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.