summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/MaxRecursionDepth/variable_watch.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/MaxRecursionDepth/variable_watch.cmake')
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/variable_watch.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch.cmake b/Tests/RunCMake/MaxRecursionDepth/variable_watch.cmake
new file mode 100644
index 0000000..b3c7b8d
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch.cmake
@@ -0,0 +1,9 @@
+function(update_x)
+ message("${x}")
+ math(EXPR y "${x} + 2")
+ variable_watch(x update_x)
+ set(x "${y}")
+endfunction()
+
+variable_watch(x update_x)
+set(x 4)