https://github.com/Kitware/CMake
Raw File
Tip revision: 8bcba75b1c12d69f0649e23173e3b19672b068e2 authored by Brad King on 14 July 2023, 15:03:52 UTC
CMake 3.27.0-rc5
Tip revision: 8bcba75
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