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.
This commit is contained in:
Brad King
2008-12-17 08:24:35 -05:00
parent 093cfc22f1
commit 625ef26163
7 changed files with 919 additions and 599 deletions
+7
View File
@@ -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"