summaryrefslogtreecommitdiffstats
path: root/Help/command
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2021-05-20 13:14:30 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2021-05-20 15:50:13 (GMT)
commitd96eb5528276a19d79116d842389f3ea165ef21b (patch)
treed9b7bebf4ced2582efba39187c41476171508384 /Help/command
parent34f9a551ce5631baef159076c697dd8f86daa8b8 (diff)
downloadCMake-d96eb5528276a19d79116d842389f3ea165ef21b.zip
CMake-d96eb5528276a19d79116d842389f3ea165ef21b.tar.gz
CMake-d96eb5528276a19d79116d842389f3ea165ef21b.tar.bz2
set(CACHE): do not remove normal variable
Fixes: #22038
Diffstat (limited to 'Help/command')
-rw-r--r--Help/command/set.rst10
1 files changed, 7 insertions, 3 deletions
diff --git a/Help/command/set.rst b/Help/command/set.rst
index c0e02e2..af862e4 100644
--- a/Help/command/set.rst
+++ b/Help/command/set.rst
@@ -68,9 +68,13 @@ users.
If the cache entry does not exist prior to the call or the ``FORCE``
option is given then the cache entry will be set to the given value.
-Furthermore, any normal variable binding in the current scope will
-be removed to expose the newly cached value to any immediately
-following evaluation.
+
+.. note::
+
+ The content of the cache variable will not be directly accessible if a normal
+ variable of the same name already exists (see :ref:`rules of variable
+ evaluation <CMake Language Variables>`). If policy :policy:`CMP0126` is set
+ to ``OLD``, any normal variable binding in the current scope will be removed.
It is possible for the cache entry to exist prior to the call but
have no type set if it was created on the :manual:`cmake(1)` command