1 cmake_minimum_required(VERSION 2.6)
2 project(EnvironmentProj)
4 add_executable(Environment main.cxx)
8 add_test(Environment1 Environment)
9 add_test(Environment2 Environment)
10 add_test(EchoEnvironment1 ${CMAKE_COMMAND} -E environment)
11 add_test(EchoEnvironment2 ${CMAKE_COMMAND} -E environment)
13 # Make sure "CMAKE_ENV.*Happy Thanksgiving" is in the output of
16 set_tests_properties(Environment1 EchoEnvironment1 PROPERTIES
17 ENVIRONMENT "CMAKE_ENVIRONMENT_TEST_VAR=Happy Thanksgiving!"
18 PASS_REGULAR_EXPRESSION "CMAKE_ENV.*Happy Thanksgiving"
21 # Make sure "CMAKE_ENV.*Happy Thanksgiving" is *NOT* in the output of
24 set_tests_properties(Environment2 EchoEnvironment2 PROPERTIES
25 FAIL_REGULAR_EXPRESSION "CMAKE_ENV.*Happy Thanksgiving"