summaryrefslogtreecommitdiffstats
path: root/Help/command/set.rst
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2022-08-05 08:55:32 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2022-08-22 14:25:53 (GMT)
commit44a2f3f3324a608062eb7b88072c7640f80f4a5c (patch)
treebcb7ee5b371d05c71d76fb12214c0b82039fa2de /Help/command/set.rst
parent604993248fdee0bec8ab8c74c1173c67496a7dfd (diff)
downloadCMake-44a2f3f3324a608062eb7b88072c7640f80f4a5c.zip
CMake-44a2f3f3324a608062eb7b88072c7640f80f4a5c.tar.gz
CMake-44a2f3f3324a608062eb7b88072c7640f80f4a5c.tar.bz2
Add new flow-control commands for variables and policies scopes management
Add block() and endblock() commands offering the capability to create new scopes for variables and/or policies. Fixes: #20171
Diffstat (limited to 'Help/command/set.rst')
-rw-r--r--Help/command/set.rst17
1 files changed, 11 insertions, 6 deletions
diff --git a/Help/command/set.rst b/Help/command/set.rst
index af862e4..aa2ea55 100644
--- a/Help/command/set.rst
+++ b/Help/command/set.rst
@@ -22,12 +22,17 @@ Set Normal Variable
Sets the given ``<variable>`` in the current function or directory scope.
If the ``PARENT_SCOPE`` option is given the variable will be set in
-the scope above the current scope. Each new directory or function
-creates a new scope. This command will set the value of a variable
-into the parent directory or calling function (whichever is applicable
-to the case at hand). The previous state of the variable's value stays the
-same in the current scope (e.g., if it was undefined before, it is still
-undefined and if it had a value, it is still that value).
+the scope above the current scope. Each new directory or :command:`function`
+command creates a new scope. A scope can also be created with the
+:command:`block` command. This command will set the value of a variable into
+the parent directory, calling function or encompassing scope (whichever is
+applicable to the case at hand). The previous state of the variable's value
+stays the same in the current scope (e.g., if it was undefined before, it is
+still undefined and if it had a value, it is still that value).
+
+The :command:`block(PROPAGATE)` command can be used as an alternate method to
+:command:`set(PARENT_SCOPE)` and :command:`unset(PARENT_SCOPE)` commands to
+update the parent scope.
Set Cache Entry
^^^^^^^^^^^^^^^