summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/cmake_language/defer_call
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-09-21 17:51:35 (GMT)
committerBrad King <brad.king@kitware.com>2020-09-29 21:12:33 (GMT)
commite8b0359a4318bb682c96e527de7ed7f5be02c38f (patch)
tree5ea4137b78124e4619bb4aff1856a04b729f93fd /Tests/RunCMake/cmake_language/defer_call
parent98805494055f8fb4afc2da9f96a487987333981a (diff)
downloadCMake-e8b0359a4318bb682c96e527de7ed7f5be02c38f.zip
CMake-e8b0359a4318bb682c96e527de7ed7f5be02c38f.tar.gz
CMake-e8b0359a4318bb682c96e527de7ed7f5be02c38f.tar.bz2
cmake_language: Add signature to DEFER calls to later times
Fixes: #19575
Diffstat (limited to 'Tests/RunCMake/cmake_language/defer_call')
-rw-r--r--Tests/RunCMake/cmake_language/defer_call/CMakeLists.txt11
-rw-r--r--Tests/RunCMake/cmake_language/defer_call/include.cmake1
2 files changed, 12 insertions, 0 deletions
diff --git a/Tests/RunCMake/cmake_language/defer_call/CMakeLists.txt b/Tests/RunCMake/cmake_language/defer_call/CMakeLists.txt
new file mode 100644
index 0000000..544b9f4
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/defer_call/CMakeLists.txt
@@ -0,0 +1,11 @@
+cmake_policy(SET CMP0053 OLD)
+cmake_language(DEFER ID id1 CALL message STATUS "Deferred Message In Subdirectory: '${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}'")
+cmake_language(DEFER ID id2 CALL
+ cmake_language DEFER ID id3 CALL
+ message WARNING "Double-Deferred Warning In Subdirectory:\n '${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}'")
+cmake_language(DEFER ID id4 CALL include "${CMAKE_CURRENT_LIST_DIR}/include.cmake")
+
+set(subdir_message "This should not be printed because variable evaluation is in deferred scope.")
+cmake_language(DEFER DIRECTORY .. CALL message STATUS "${subdir_message}")
+cmake_language(DEFER DIRECTORY .. GET_CALL_IDS ids)
+message(STATUS "Immediate Message In Subdirectory: ids='${ids}'")
diff --git a/Tests/RunCMake/cmake_language/defer_call/include.cmake b/Tests/RunCMake/cmake_language/defer_call/include.cmake
new file mode 100644
index 0000000..272c61b
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/defer_call/include.cmake
@@ -0,0 +1 @@
+message(STATUS "Deferred Message In Included File: '${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}'")