ENH: Added test for IF(DEFINED ENV{var})(.

This commit is contained in:
Brad King 2006-02-10 15:45:27 -05:00
parent 85a69c1b9c
commit de8080c76f
1 changed files with 7 additions and 0 deletions

View File

@ -73,9 +73,16 @@ ELSE(THIS_SHOULD_BE_SET)
MESSAGE(FATAL_ERROR "PreLoad.cmake does not work.")
ENDIF(THIS_SHOULD_BE_SET)
IF(DEFINED ENV{TEST_ENVIRONMENT_VARIABLE_NOTSET})
MESSAGE(SEND_ERROR "Environment variable definition test broken!")
ENDIF(DEFINED ENV{TEST_ENVIRONMENT_VARIABLE_NOTSET})
SET(ENV{TEST_ENVIRONMENT_VARIABLE} "Environment variable set")
IF("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set")
MESSAGE(STATUS "Environment variable set to: $ENV{TEST_ENVIRONMENT_VARIABLE}")
IF(NOT DEFINED ENV{TEST_ENVIRONMENT_VARIABLE})
MESSAGE(SEND_ERROR "Environment variable definition test failed!")
ENDIF(NOT DEFINED ENV{TEST_ENVIRONMENT_VARIABLE})
ELSE("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set")
MESSAGE(SEND_ERROR "Environment variable setting is broken")
ENDIF("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set")