diff options
Diffstat (limited to 'Tests/RunCMake/option')
-rw-r--r-- | Tests/RunCMake/option/CMP0077-SECOND-PASS.cmake | 14 | ||||
-rw-r--r-- | Tests/RunCMake/option/RunCMakeTest.cmake | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/Tests/RunCMake/option/CMP0077-SECOND-PASS.cmake b/Tests/RunCMake/option/CMP0077-SECOND-PASS.cmake new file mode 100644 index 0000000..f62a853 --- /dev/null +++ b/Tests/RunCMake/option/CMP0077-SECOND-PASS.cmake @@ -0,0 +1,14 @@ + +#Verify that when both a cache and local version of a value exist that CMake +#doesn't produce a CMP0077 warning and that we get the expected values. +option(OPT_LOCAL_VAR "TEST_VAR" ON) +set(OPT_LOCAL_VAR FALSE) +option(OPT_LOCAL_VAR "TEST_VAR" ON) +if(OPT_LOCAL_VAR) + message(FATAL_ERROR "option improperly set a cache variable that already exists") +endif() + +get_property(_exists_in_cache CACHE OPT_LOCAL_VAR PROPERTY VALUE SET) +if(NOT _exists_in_cache) + message(FATAL_ERROR "value should exist in cache") +endif() diff --git a/Tests/RunCMake/option/RunCMakeTest.cmake b/Tests/RunCMake/option/RunCMakeTest.cmake index 0501624..979afa1 100644 --- a/Tests/RunCMake/option/RunCMakeTest.cmake +++ b/Tests/RunCMake/option/RunCMakeTest.cmake @@ -3,3 +3,4 @@ include(RunCMake) run_cmake(CMP0077-OLD) run_cmake(CMP0077-NEW) run_cmake(CMP0077-WARN) +run_cmake(CMP0077-SECOND-PASS) |