cmake/Tests/RunCMake/CommandLine/E_env-equal.cmake

16 lines
686 B
CMake
Raw Normal View History

2022-11-16 20:14:03 +01:00
if (NOT DEFINED ENV{TEST_ENV_EXPECTED})
if (NOT DEFINED ENV{TEST_ENV})
message(STATUS "TEST_ENV is correctly not set in environment")
else ()
message(FATAL_ERROR "TEST_ENV is incorrectly set in environment")
endif ()
else ()
if (NOT DEFINED ENV{TEST_ENV})
message(FATAL_ERROR "TEST_ENV is incorrectly not set in environment")
elseif ("$ENV{TEST_ENV}" STREQUAL "$ENV{TEST_ENV_EXPECTED}")
message(STATUS "TEST_ENV is correctly set in environment: $ENV{TEST_ENV}")
else ()
message(FATAL_ERROR "TEST_ENV is incorrectly set in environment!\n\tactual: $ENV{TEST_ENV}\n\texpected: $ENV{TEST_ENV_EXPECTED}")
endif ()
endif ()