diff options
author | Joachim Wuttke (l) <j.wuttke@fz-juelich.de> | 2018-11-01 10:13:03 (GMT) |
---|---|---|
committer | Joachim Wuttke (h) <j.wuttke@fz-juelich.de> | 2018-11-08 19:27:49 (GMT) |
commit | 8ba2a8d4a415d2288786a0d56e90b3d7693ad32e (patch) | |
tree | 235884135ef9892c239e132ac96d709c04125b2a /Help/manual/cmake-language.7.rst | |
parent | 85498fccd8ac1dd7345d995e52e1bf63d663071e (diff) | |
download | CMake-8ba2a8d4a415d2288786a0d56e90b3d7693ad32e.zip CMake-8ba2a8d4a415d2288786a0d56e90b3d7693ad32e.tar.gz CMake-8ba2a8d4a415d2288786a0d56e90b3d7693ad32e.tar.bz2 |
Help: short/long variable reference in if command
Explain that the short form of variable references
in the if command does not apply to ENV and CACHE vars.
Diffstat (limited to 'Help/manual/cmake-language.7.rst')
-rw-r--r-- | Help/manual/cmake-language.7.rst | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Help/manual/cmake-language.7.rst b/Help/manual/cmake-language.7.rst index 1b5281a..5e5cfff 100644 --- a/Help/manual/cmake-language.7.rst +++ b/Help/manual/cmake-language.7.rst @@ -389,7 +389,7 @@ historical considerations.) Variable References ------------------- -A *variable reference* has the form ``${variable_name}`` and is +A *variable reference* has the form ``${<variable>}`` and is evaluated inside a `Quoted Argument`_ or an `Unquoted Argument`_. A variable reference is replaced by the value of the variable, or by the empty string if the variable is not set. @@ -405,12 +405,18 @@ the ``$`` is also technically permitted but is discouraged. The `Variables`_ section documents the scope of variable names and how their values are set. -An *environment variable reference* has the form ``$ENV{VAR}``. +An *environment variable reference* has the form ``$ENV{<variable>}``. See the `Environment Variables`_ section for more information. -A *cache variable reference* has the form ``$CACHE{VAR}``. +A *cache variable reference* has the form ``$CACHE{<variable>}``. See :variable:`CACHE` for more information. +The :command:`if` command has a special condition syntax that +allows for variable references in the short form ``<variable>`` +instead of ``${<variable>}``. +However, environment and cache variables always need to be +referenced as ``$ENV{<variable>}`` or ``$CACHE{<variable>}``. + Comments -------- |