summaryrefslogtreecommitdiff
path: root/Help/policy/CMP0126.rst
blob: 0ced8fa5aae5bd6742f3fdeff3a565babbf0d2e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
CMP0126
-------

.. versionadded:: 3.21

The :command:`set(CACHE)` does not remove a normal variable of the same name.

Starting with CMake 3.21, the :command:`set(CACHE)` does not remove, in the
current scope, any normal variable with the same name.

The ``OLD`` behavior for this policy is to have the :command:`set(CACHE)`
command removing the normal variable of the same name, if any. The ``NEW``
behavior for this policy is to keep the normal variable of the same name.

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.  See documentation of the
:variable:`CMAKE_POLICY_WARNING_CMP0126 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
variable to control the warning.

.. include:: DEPRECATED.txt