From ee4e728a69d0913ca6f80943764724e02ceb2e11 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" Date: Wed, 4 May 2022 15:01:53 +0200 Subject: Help: From Environment Variables section, link to cmake -E env etc --- Help/manual/cmake-language.7.rst | 7 +++++++ Help/manual/cmake.1.rst | 2 ++ 2 files changed, 9 insertions(+) diff --git a/Help/manual/cmake-language.7.rst b/Help/manual/cmake-language.7.rst index e7d2694..595f114 100644 --- a/Help/manual/cmake-language.7.rst +++ b/Help/manual/cmake-language.7.rst @@ -594,6 +594,13 @@ Initialization Changed values are not written back to the calling process, and they are not seen by subsequent build or test processes. + See the :ref:`cmake -E env ` command-line + tool to run a command in a modified environment. + +Inspection + See the :ref:`cmake -E environment ` command-line + tool to display all current environment variables. + The :manual:`cmake-env-variables(7)` manual documents environment variables that have special meaning to CMake. diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index 3ef7b3f..3c5c46c 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -619,6 +619,8 @@ in the set of :variable:`CMAKE_ARGV ` variables passed to the script (including the ``--`` itself). +.. _`Run a Command-Line Tool`: + Run a Command-Line Tool ======================= -- cgit v0.12 From ab2bdbaf31e308031ae56b31b48cf6da091566cf Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" Date: Wed, 4 May 2022 15:10:20 +0200 Subject: Help: Cross-reference ENV operator from cmake-language(7) manual --- Help/manual/cmake-language.7.rst | 3 ++- Help/variable/ENV.rst | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Help/manual/cmake-language.7.rst b/Help/manual/cmake-language.7.rst index 595f114..02cfa7e 100644 --- a/Help/manual/cmake-language.7.rst +++ b/Help/manual/cmake-language.7.rst @@ -582,7 +582,8 @@ Scope They are never cached. References - `Variable References`_ have the form ``$ENV{}``. + `Variable References`_ have the form ``$ENV{}``, using the + :variable:`ENV` operator. Initialization Initial values of the CMake environment variables are those of diff --git a/Help/variable/ENV.rst b/Help/variable/ENV.rst index 2b43934..6791853 100644 --- a/Help/variable/ENV.rst +++ b/Help/variable/ENV.rst @@ -8,5 +8,6 @@ Use the syntax ``$ENV{VAR}`` to read environment variable ``VAR``. To test whether an environment variable is defined, use the signature ``if(DEFINED ENV{})`` of the :command:`if` command. -See the :command:`set` and :command:`unset` commands to see how to -write or remove environment variables. +For general information on environment variables, see the +:ref:`Environment Variables ` +section in the :manual:`cmake-language(7)` manual. -- cgit v0.12 From a693da21f3ac17ca6201b8b6cf4865295c0fe260 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" Date: Wed, 4 May 2022 15:13:53 +0200 Subject: Help: from command:if, link to environment variables --- Help/command/if.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Help/command/if.rst b/Help/command/if.rst index 4f955db..64f1c35 100644 --- a/Help/command/if.rst +++ b/Help/command/if.rst @@ -71,8 +71,9 @@ Basic Expressions True if given a variable that is defined to a value that is not a false constant. False otherwise, including if the variable is undefined. Note that macro arguments are not variables. - Environment variables also cannot be tested this way, e.g. - ``if(ENV{some_var})`` will always evaluate to false. + :ref:`Environment Variables ` also + cannot be tested this way, e.g. ``if(ENV{some_var})`` will always evaluate + to false. ``if()`` A quoted string always evaluates to false unless: -- cgit v0.12