Help: Describe $CACHE and $ENV as operators

This resolves issue #18514

Also add a cross-reference to if(DEFINED ENV{var}).
This commit is contained in:
Joachim Wuttke (l) 2018-11-01 11:18:15 +01:00 committed by Joachim Wuttke (h)
parent e855bd5248
commit 860338491e
3 changed files with 18 additions and 6 deletions

View File

@ -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

View File

@ -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.

View File

@ -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.