https://github.com/Kitware/CMake
Raw File
Tip revision: ed084886b7c1feb1ac663063d753d49f4fafcd0b authored by Brad King on 12 October 2022, 14:23:58 UTC
CMake 3.25.0-rc1
Tip revision: ed08488
ENV.rst
ENV
---

Operator to read environment variables.

Use the syntax ``$ENV{VAR}`` to read environment variable ``VAR``.

To test whether an environment variable is defined, use the signature
``if(DEFINED ENV{<name>})`` of the :command:`if` command.

For general information on environment variables, see the
:ref:`Environment Variables <CMake Language Environment Variables>`
section in the :manual:`cmake-language(7)` manual.
back to top