https://github.com/Kitware/CMake
Raw File
Tip revision: 3b4bd019ffb088bbf34fbdbc7512a086d652c7d4 authored by Brad King on 14 June 2022, 16:11:11 UTC
CMake 3.24.0-rc1
Tip revision: 3b4bd01
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