https://github.com/Kitware/CMake
Raw File
Tip revision: 0926ed1f69aee7fdb454e10d9b98016c3dfc4e7e authored by Brad King on 18 May 2023, 17:49:44 UTC
CMake 3.26.4
Tip revision: 0926ed1
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