summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorJoachim Wuttke (l) <j.wuttke@fz-juelich.de>2018-11-01 10:18:15 (GMT)
committerJoachim Wuttke (h) <j.wuttke@fz-juelich.de>2018-11-08 19:33:13 (GMT)
commit860338491ee96274ac110459b3b316149d4585f7 (patch)
treeb754fa362154500439dd8e93e16147cf60d41347 /Help
parente855bd5248bbb7b77b45e269e4fa098b29c9e889 (diff)
downloadCMake-860338491ee96274ac110459b3b316149d4585f7.zip
CMake-860338491ee96274ac110459b3b316149d4585f7.tar.gz
CMake-860338491ee96274ac110459b3b316149d4585f7.tar.bz2
Help: Describe $CACHE and $ENV as operators
This resolves issue #18514 Also add a cross-reference to if(DEFINED ENV{var}).
Diffstat (limited to 'Help')
-rw-r--r--Help/manual/cmake-variables.7.rst11
-rw-r--r--Help/variable/CACHE.rst5
-rw-r--r--Help/variable/ENV.rst8
3 files changed, 18 insertions, 6 deletions
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index efb217d..7a7f0b8 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -241,7 +241,6 @@ Variables that Describe the System
/variable/ANDROID
/variable/APPLE
/variable/BORLAND
- /variable/CACHE
/variable/CMAKE_CL_64
/variable/CMAKE_COMPILER_2005
/variable/CMAKE_HOST_APPLE
@@ -260,7 +259,6 @@ Variables that Describe the System
/variable/CMAKE_SYSTEM_PROCESSOR
/variable/CMAKE_SYSTEM_VERSION
/variable/CYGWIN
- /variable/ENV
/variable/GHS-MULTI
/variable/MINGW
/variable/MSVC
@@ -599,3 +597,12 @@ Variables for CPack
/variable/CPACK_PACKAGING_INSTALL_PREFIX
/variable/CPACK_SET_DESTDIR
/variable/CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION
+
+Variable Expansion Operators
+============================
+
+.. toctree::
+ :maxdepth: 1
+
+ /variable/CACHE
+ /variable/ENV
diff --git a/Help/variable/CACHE.rst b/Help/variable/CACHE.rst
index 230739a..2cef27e 100644
--- a/Help/variable/CACHE.rst
+++ b/Help/variable/CACHE.rst
@@ -1,7 +1,7 @@
CACHE
-----
-Read cache variables.
+Operator to read cache variables.
Use the syntax ``$CACHE{VAR}`` to read cache entry ``VAR``.
See the :ref:`cmake-language(7) variables <CMake Language Variables>`
@@ -14,4 +14,5 @@ found CMake will search for a cache entry with that name.
The ``$CACHE{VAR}`` syntax can be used to do direct cache lookup and
ignore any existing normal variable.
-See the :command:`set` command to see how to write cache variables.
+See the :command:`set` and :command:`unset` commands to see how to
+write or remove cache variables.
diff --git a/Help/variable/ENV.rst b/Help/variable/ENV.rst
index 98677dd..2b43934 100644
--- a/Help/variable/ENV.rst
+++ b/Help/variable/ENV.rst
@@ -1,8 +1,12 @@
ENV
---
-Read environment variables.
+Operator to read environment variables.
Use the syntax ``$ENV{VAR}`` to read environment variable ``VAR``.
-See the :command:`set` command to see how to write environment variables.
+To test whether an environment variable is defined, use the signature
+``if(DEFINED ENV{<name>})`` of the :command:`if` command.
+
+See the :command:`set` and :command:`unset` commands to see how to
+write or remove environment variables.