summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS-check.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS-check.cmake')
-rw-r--r--Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS-check.cmake17
1 files changed, 17 insertions, 0 deletions
diff --git a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS-check.cmake b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS-check.cmake
new file mode 100644
index 0000000..c1e4204
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS-check.cmake
@@ -0,0 +1,17 @@
+set(_cache_file "${RunCMake_TEST_BINARY_DIR}/tmp/FOO-cache.cmake")
+
+if(NOT EXISTS "${_cache_file}")
+ set(RunCMake_TEST_FAILED "Initial cache not created")
+ return()
+endif()
+
+file(READ "${_cache_file}" _cache)
+
+if(NOT "${_cache}" MATCHES "set\\(FOO \"BAR\".+\\)") # \(\)
+ set(RunCMake_TEST_FAILED "Cannot find FOO argument in cache")
+ return()
+endif()
+if(NOT "${CMAKE_MATCH_0}" MATCHES FORCE)
+ set(RunCMake_TEST_FAILED "Expected forced FOO argument")
+ return()
+endif()