summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-04-12 15:32:31 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-04-12 15:32:37 (GMT)
commit2cdefcbe62707a82eccbc301fe34f85bb74d932a (patch)
treefca403211b0449955f38e3f7dfdb6ea9169e314a /Tests
parentd59cd3b131a0c18d93fbc04f745bed990cfefa31 (diff)
parent65198cfd0f96d51269c748a84bafe27cf3312abd (diff)
downloadCMake-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.txt2
-rw-r--r--Tests/RunCMake/variable_watch/RaiseInParentScope.cmake15
-rw-r--r--Tests/RunCMake/variable_watch/RunCMakeTest.cmake1
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)