swh:1:snp:a6330e89b35f0959a588079a2c4dc65f44d6e08a
Raw File
Tip revision: 0926ed1f69aee7fdb454e10d9b98016c3dfc4e7e authored by Brad King on 18 May 2023, 17:49:44 UTC
CMake 3.26.4
Tip revision: 0926ed1
CACHE.rst
CACHE
-----

.. versionadded:: 3.13

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

See the :command:`set` and :command:`unset` commands to see how to
write or remove cache variables.
back to top