diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2021-05-20 13:14:30 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2021-05-20 15:50:13 (GMT) |
commit | d96eb5528276a19d79116d842389f3ea165ef21b (patch) | |
tree | d9b7bebf4ced2582efba39187c41476171508384 /Help/policy/CMP0126.rst | |
parent | 34f9a551ce5631baef159076c697dd8f86daa8b8 (diff) | |
download | CMake-d96eb5528276a19d79116d842389f3ea165ef21b.zip CMake-d96eb5528276a19d79116d842389f3ea165ef21b.tar.gz CMake-d96eb5528276a19d79116d842389f3ea165ef21b.tar.bz2 |
set(CACHE): do not remove normal variable
Fixes: #22038
Diffstat (limited to 'Help/policy/CMP0126.rst')
-rw-r--r-- | Help/policy/CMP0126.rst | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Help/policy/CMP0126.rst b/Help/policy/CMP0126.rst new file mode 100644 index 0000000..4c8e928 --- /dev/null +++ b/Help/policy/CMP0126.rst @@ -0,0 +1,20 @@ +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. + +.. include:: DEPRECATED.txt |