cmake/Help/variable/CACHE.rst

19 lines
685 B
ReStructuredText
Raw Normal View History

2018-10-28 12:09:07 +01:00
CACHE
-----
2019-11-11 23:01:05 +01:00
Operator to read cache variables.
2018-10-28 12:09:07 +01:00
Use the syntax ``$CACHE{VAR}`` to read cache entry ``VAR``.
See the :ref:`cmake-language(7) variables <CMake Language Variables>`
documentation for more complete documentation of the interaction of
normal variables and cache entries.
When evaluating :ref:`Variable References` of the form ``${VAR}``,
CMake first searches for a normal variable with that name, and if not
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.
2019-11-11 23:01:05 +01:00
See the :command:`set` and :command:`unset` commands to see how to
write or remove cache variables.