https://github.com/Kitware/CMake
Revision 4c54b2662387a34e1dbe7f238f805ed22f0297f2 authored by Kitware Robot on 18 September 2021, 04:01:14 UTC, committed by Kitware Robot on 18 September 2021, 04:01:14 UTC
1 parent 7b09ff1
Raw File
Tip revision: 4c54b2662387a34e1dbe7f238f805ed22f0297f2 authored by Kitware Robot on 18 September 2021, 04:01:14 UTC
CMake Nightly Date Stamp
Tip revision: 4c54b26
CMP0124.rst
CMP0124
-------

.. versionadded:: 3.21

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.

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.
Unlike many policies, CMake version |release| does *not* warn when the policy
is not set and simply uses ``OLD`` behavior.

.. include:: DEPRECATED.txt
back to top