diff options
author | Brad King <brad.king@kitware.com> | 2018-04-12 15:32:31 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-04-12 15:32:37 (GMT) |
commit | 2cdefcbe62707a82eccbc301fe34f85bb74d932a (patch) | |
tree | fca403211b0449955f38e3f7dfdb6ea9169e314a /Tests | |
parent | d59cd3b131a0c18d93fbc04f745bed990cfefa31 (diff) | |
parent | 65198cfd0f96d51269c748a84bafe27cf3312abd (diff) | |
download | CMake-2cdefcbe62707a82eccbc301fe34f85bb74d932a.zip CMake-2cdefcbe62707a82eccbc301fe34f85bb74d932a.tar.gz CMake-2cdefcbe62707a82eccbc301fe34f85bb74d932a.tar.bz2 |
Merge topic 'variable_watch-on-PARENT_SCOPE'
65198cfd0f variable_watch: trigger on variables set via PARENT_SCOPE
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1948
Diffstat (limited to 'Tests')
-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) |