1CMP0124 2------- 3 4.. versionadded:: 3.21 5 6When this policy is set to ``NEW``, the scope of loop variables defined by the 7:command:`foreach` command is restricted to the loop only. They will be unset 8at the end of the loop. 9 10The ``OLD`` behavior for this policy still clears the loop variables at the end 11of the loop, but does not unset them. This leaves them as defined, but empty. 12 13This policy was introduced in CMake version 3.21. Use the 14:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly. 15Unlike many policies, CMake version |release| does *not* warn when the policy 16is not set and simply uses ``OLD`` behavior. 17 18.. include:: DEPRECATED.txt 19