diff options
author | Matteo Settenvini <matteo.settenvini@here.com> | 2018-04-10 09:16:44 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-04-11 19:02:07 (GMT) |
commit | 65198cfd0f96d51269c748a84bafe27cf3312abd (patch) | |
tree | 71ef8e1935f1f8e973d5f668b65d6f4b44a174f7 /Tests/RunCMake/variable_watch | |
parent | e769e61f992ba0c0028e28bdf7531f495a625925 (diff) | |
download | CMake-65198cfd0f96d51269c748a84bafe27cf3312abd.zip CMake-65198cfd0f96d51269c748a84bafe27cf3312abd.tar.gz CMake-65198cfd0f96d51269c748a84bafe27cf3312abd.tar.bz2 |
variable_watch: trigger on variables set via PARENT_SCOPE
Make sure that we also trigger variable watches when a variable
is set in the parent scope.
Fixes: #17827
Diffstat (limited to 'Tests/RunCMake/variable_watch')
-rw-r--r-- | Tests/RunCMake/variable_watch/RaiseInParentScope-stderr.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/variable_watch/RaiseInParentScope.cmake | 15 | ||||
-rw-r--r-- | Tests/RunCMake/variable_watch/RunCMakeTest.cmake | 1 |
3 files changed, 18 insertions, 0 deletions
diff --git a/Tests/RunCMake/variable_watch/RaiseInParentScope-stderr.txt b/Tests/RunCMake/variable_watch/RaiseInParentScope-stderr.txt new file mode 100644 index 0000000..51db19c --- /dev/null +++ b/Tests/RunCMake/variable_watch/RaiseInParentScope-stderr.txt @@ -0,0 +1,2 @@ +var MODIFIED_ACCESS a +var MODIFIED_ACCESS b diff --git a/Tests/RunCMake/variable_watch/RaiseInParentScope.cmake b/Tests/RunCMake/variable_watch/RaiseInParentScope.cmake new file mode 100644 index 0000000..207798e --- /dev/null +++ b/Tests/RunCMake/variable_watch/RaiseInParentScope.cmake @@ -0,0 +1,15 @@ + +function(watch variable access value) + message("${variable} ${access} ${value}") +endfunction () + +# -------------- + +variable_watch(var watch) +set(var "a") + +function(f) + set(var "b" PARENT_SCOPE) +endfunction(f) + +f() diff --git a/Tests/RunCMake/variable_watch/RunCMakeTest.cmake b/Tests/RunCMake/variable_watch/RunCMakeTest.cmake index 2fa6275..3883999 100644 --- a/Tests/RunCMake/variable_watch/RunCMakeTest.cmake +++ b/Tests/RunCMake/variable_watch/RunCMakeTest.cmake @@ -4,3 +4,4 @@ run_cmake(ModifiedAccess) run_cmake(NoWatcher) run_cmake(WatchTwice) run_cmake(ModifyWatchInCallback) +run_cmake(RaiseInParentScope) |