ENV

From Get docs
Cmake/docs/3.21/variable/env


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 if() command.

See the set() and unset() commands to see how to write or remove environment variables.

© 2000–2021 Kitware, Inc. and Contributors
Licensed under the BSD 3-clause License.
https://cmake.org/cmake/help/v3.21/variable/ENV.html