summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CommandLine/E_env-set.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-06-23 20:33:33 (GMT)
committerBrad King <brad.king@kitware.com>2014-06-23 20:47:49 (GMT)
commit7abd574798f9900abfe502f3941cffaa774062b1 (patch)
treec930e472ac4fdb02b18b1ea3743d56013c3e4bf5 /Tests/RunCMake/CommandLine/E_env-set.cmake
parent0474aa4a78d74f971f6be5d3c4209c46bd6e02e9 (diff)
downloadCMake-7abd574798f9900abfe502f3941cffaa774062b1.zip
CMake-7abd574798f9900abfe502f3941cffaa774062b1.tar.gz
CMake-7abd574798f9900abfe502f3941cffaa774062b1.tar.bz2
cmake: Add '-E env' command-line tool
Extend the cmake command-line interface to support cmake -E env [--unset=NAME]... [NAME=VALUE]... COMMAND [ARG]... This will be useful to run processes with modified environments without using a shell or a full "cmake -P" script to wrap it. Extend the RunCMake.CommandLine test to cover success and failure cases. Inspired-by: Jonathan Bohren <jbo@jhu.edu>
Diffstat (limited to 'Tests/RunCMake/CommandLine/E_env-set.cmake')
-rw-r--r--Tests/RunCMake/CommandLine/E_env-set.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/Tests/RunCMake/CommandLine/E_env-set.cmake b/Tests/RunCMake/CommandLine/E_env-set.cmake
new file mode 100644
index 0000000..c2639b6
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_env-set.cmake
@@ -0,0 +1,5 @@
+if(DEFINED ENV{TEST_ENV})
+ message(STATUS "TEST_ENV is correctly set in environment: $ENV{TEST_ENV}")
+else()
+ message(FATAL_ERROR "TEST_ENV is incorrectly not set in environment")
+endif()