diff options
author | Brad King <brad.king@kitware.com> | 2013-10-09 14:22:10 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-10-09 14:22:10 (GMT) |
commit | 8424d569f0f347c084e919d5c6037ccadb959dab (patch) | |
tree | 52ede225888707eceaefa7546b06a09737d23afc /Tests | |
parent | 12a7e2b10c447e3ed61c2bca69f0264f7fcbdef9 (diff) | |
parent | 261c248254faf2fc09d71f456f018b7f8bc9a7f1 (diff) | |
download | CMake-8424d569f0f347c084e919d5c6037ccadb959dab.zip CMake-8424d569f0f347c084e919d5c6037ccadb959dab.tar.gz CMake-8424d569f0f347c084e919d5c6037ccadb959dab.tar.bz2 |
Merge topic 'unset-PARENT_SCOPE'
261c248 unset: Add PARENT_SCOPE option
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/Unset/CMakeLists.txt | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Tests/Unset/CMakeLists.txt b/Tests/Unset/CMakeLists.txt index 781da3f..07aa68e 100644 --- a/Tests/Unset/CMakeLists.txt +++ b/Tests/Unset/CMakeLists.txt @@ -51,5 +51,32 @@ if(DEFINED BAR) message(FATAL_ERROR "BAR still defined") endif() +# Test unset(... PARENT_SCOPE) +function(unset_zots) + if(NOT DEFINED ZOT1) + message(FATAL_ERROR "ZOT1 is not defined inside function") + endif() + if(NOT DEFINED ZOT2) + message(FATAL_ERROR "ZOT2 is not defined inside function") + endif() + unset(ZOT1) + unset(ZOT2 PARENT_SCOPE) + if(DEFINED ZOT1) + message(FATAL_ERROR "ZOT1 is defined inside function after unset") + endif() + if(NOT DEFINED ZOT2) + message(FATAL_ERROR + "ZOT2 is not defined inside function after unset(... PARENT_SCOPE)") + endif() +endfunction() +set(ZOT1 1) +set(ZOT2 2) +unset_zots() +if(NOT DEFINED ZOT1) + message(FATAL_ERROR "ZOT1 is not still defined after function") +endif() +if(DEFINED ZOT2) + message(FATAL_ERROR "ZOT2 is still defined after function unset PARENT_SCOPE") +endif() add_executable(Unset unset.c) |