CMP0126

From Get docs
Cmake/docs/3.21/policy/cmp0126


CMP0126

New in version 3.21.


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

Starting with CMake 3.21, the 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 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 cmake_policy() command to set it to OLD or NEW explicitly. Unlike many policies, CMake version 3.21.0-rc3 does not warn when the policy is not set and simply uses OLD behavior. See documentation of the CMAKE_POLICY_WARNING_CMP0126 variable to control the warning.

Note

The OLD behavior of a policy is deprecated by definition and may be removed in a future version of CMake.


© 2000–2021 Kitware, Inc. and Contributors
Licensed under the BSD 3-clause License.
https://cmake.org/cmake/help/v3.21/policy/CMP0126.html