E_env-equal.cmake 686 B

123456789101112131415
  1. if (NOT DEFINED ENV{TEST_ENV_EXPECTED})
  2. if (NOT DEFINED ENV{TEST_ENV})
  3. message(STATUS "TEST_ENV is correctly not set in environment")
  4. else ()
  5. message(FATAL_ERROR "TEST_ENV is incorrectly set in environment")
  6. endif ()
  7. else ()
  8. if (NOT DEFINED ENV{TEST_ENV})
  9. message(FATAL_ERROR "TEST_ENV is incorrectly not set in environment")
  10. elseif ("$ENV{TEST_ENV}" STREQUAL "$ENV{TEST_ENV_EXPECTED}")
  11. message(STATUS "TEST_ENV is correctly set in environment: $ENV{TEST_ENV}")
  12. else ()
  13. message(FATAL_ERROR "TEST_ENV is incorrectly set in environment!\n\tactual: $ENV{TEST_ENV}\n\texpected: $ENV{TEST_ENV_EXPECTED}")
  14. endif ()
  15. endif ()