mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-12 17:19:05 -05:00
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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user