From 3de551cc22bf80f63ec9f05e3e934f42f79b8965 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" Date: Sat, 27 Oct 2018 15:08:43 +0200 Subject: [PATCH] Help: Clarify effect of set(ENV{..} ..) and unset(ENV{..}) Explain that the commands affect only the current CMake process, not the process from which CMake was called, nor the system environment at large, nor the environment of subsequent build or test processes. --- Help/command/set.rst | 8 +++++++- Help/command/unset.rst | 17 +++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Help/command/set.rst b/Help/command/set.rst index e37e693ccf..dd5ea133be 100644 --- a/Help/command/set.rst +++ b/Help/command/set.rst @@ -88,4 +88,10 @@ Set Environment Variable set(ENV{} ...) -Sets the current process environment ```` to the given value. +Sets an :manual:`Environment Variable ` +to the given value. +Subsequent calls of ``$ENV{}`` will return this new value. + +This command affects only the current CMake process, not the process +from which CMake was called, nor the system environment at large, +nor the environment of subsequent build or test processes. diff --git a/Help/command/unset.rst b/Help/command/unset.rst index 1a5e49f0e1..75210521ec 100644 --- a/Help/command/unset.rst +++ b/Help/command/unset.rst @@ -3,6 +3,9 @@ unset Unset a variable, cache variable, or environment variable. +Unset Normal Variable or Cache Entry +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + .. code-block:: cmake unset( [CACHE | PARENT_SCOPE]) @@ -22,11 +25,17 @@ 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. -```` can be an environment variable such as: +Unset Environment Variable +^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: cmake - unset(ENV{LD_LIBRARY_PATH}) + unset(ENV{}) -in which case the variable will be removed from the current -environment. +Removes ```` from the currently available +:manual:`Environment Variables `. +Subsequent calls of ``$ENV{}`` will return the empty string. + +This command affects only the current CMake process, not the process +from which CMake was called, nor the system environment at large, +nor the environment of subsequent build or test processes.