diff options
author | Brad King <brad.king@kitware.com> | 2008-12-17 13:24:35 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-12-17 13:24:35 (GMT) |
commit | 625ef26163451686a68b092d672e79c3e2b80e1e (patch) | |
tree | caf361740e62c2e9e727d13f84bb7dc21be59545 /Tests/StringFileTest | |
parent | 093cfc22f11ab014abe220e600e2d99c7a356851 (diff) | |
download | CMake-625ef26163451686a68b092d672e79c3e2b80e1e.zip CMake-625ef26163451686a68b092d672e79c3e2b80e1e.tar.gz CMake-625ef26163451686a68b092d672e79c3e2b80e1e.tar.bz2 |
ENH: Allow most characters in ENV variable refs
The $ENV{VAR} syntax permits access to environment variables. This
teaches CMake to recognize most characters in the VAR name since some
environments may have variables with non-C-identifier characters.
Diffstat (limited to 'Tests/StringFileTest')
-rw-r--r-- | Tests/StringFileTest/CMakeLists.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt index 8c5f3fa..f1598d7 100644 --- a/Tests/StringFileTest/CMakeLists.txt +++ b/Tests/StringFileTest/CMakeLists.txt @@ -132,6 +132,13 @@ IF(NOT result) MESSAGE(SEND_ERROR "Unquoted $(VAR) syntax is broken.") ENDIF(NOT result) +# Obscure environment variable name +SET("ENV{x+(y)}" "Obscure environment variable value") +MESSAGE("Output: [$ENV{x+(y)}]") +IF(NOT "$ENV{x+(y)}" STREQUAL "Obscure environment variable value") + MESSAGE(SEND_ERROR "Environment variable \"ENV{x+(y)}\" does not work.") +ENDIF() + # Make directories test FILE(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Includes" |