summaryrefslogtreecommitdiffstats
path: root/Help/command/unset.rst
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-03-24 18:39:48 (GMT)
committerBrad King <brad.king@kitware.com>2023-03-24 18:44:45 (GMT)
commit512f64289a94c334269a546d86f095b1fac17cc5 (patch)
tree0f583f974e7723d12d24a04c342831c8b2854064 /Help/command/unset.rst
parent3a9613d28f7d0c0c78c67e233528dc3ac97f7026 (diff)
downloadCMake-512f64289a94c334269a546d86f095b1fac17cc5.zip
CMake-512f64289a94c334269a546d86f095b1fac17cc5.tar.gz
CMake-512f64289a94c334269a546d86f095b1fac17cc5.tar.bz2
Help: Clarify that set(VAR) unsets VAR
Also call out possible exposure of an existing cache entry of the same name, as we have for the `unset` command since commit 1a0f1a25a4 (Help: Clarify the unset command, 2018-08-17, v3.13.0-rc1~199^2). Issue: #24633
Diffstat (limited to 'Help/command/unset.rst')
-rw-r--r--Help/command/unset.rst11
1 files changed, 3 insertions, 8 deletions
diff --git a/Help/command/unset.rst b/Help/command/unset.rst
index 1cd1398..522be89 100644
--- a/Help/command/unset.rst
+++ b/Help/command/unset.rst
@@ -12,19 +12,14 @@ Unset Normal Variable or Cache Entry
Removes a normal variable from the current scope, causing it
to become undefined. If ``CACHE`` is present, then a cache variable
-is removed instead of a normal variable. Note that when evaluating
-:ref:`Variable References` of the form ``${VAR}``, CMake first searches
-for a normal variable with that name. If no such normal variable exists,
-CMake will then search for a cache entry with that name. Because of this
-unsetting a normal variable can expose a cache variable that was previously
-hidden. To force a variable reference of the form ``${VAR}`` to return an
-empty string, use ``set(<variable> "")``, which clears the normal variable
-but leaves it defined.
+is removed instead of a normal variable.
If ``PARENT_SCOPE`` is present then the variable is removed from the scope
above the current scope. See the same option in the :command:`set` command
for further details.
+.. include:: UNSET_NOTE.txt
+
Unset Environment Variable
^^^^^^^^^^^^^^^^^^^^^^^^^^