summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS-check.cmake
diff options
context:
space:
mode:
authorJean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>2018-03-10 04:29:50 -0500
committerBrad King <brad.king@kitware.com>2018-03-12 13:45:50 -0400
commit7ad981c8f705ef563b8ca0bf3da98f6902fa56fe (patch)
treea3465ff8dec0f905cc05eecc0069608c7bfd17fa /Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS-check.cmake
parentc5541cf0da1093635fea7da5a40e64e481b5477e (diff)
downloadcmake-7ad981c8f705ef563b8ca0bf3da98f6902fa56fe.tar.gz
ExternalProject: Fix cache generation when last args ends with "-NOTFOUND"
Diffstat (limited to 'Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS-check.cmake')
-rw-r--r--Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS-check.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS-check.cmake b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS-check.cmake
index c84932d60c..2bef56e0af 100644
--- a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS-check.cmake
+++ b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS-check.cmake
@@ -24,3 +24,12 @@ if("${CMAKE_MATCH_0}" MATCHES FORCE)
set(RunCMake_TEST_FAILED "Expected not forced TEST_LIST argument")
return()
endif()
+
+if(NOT "${_cache}" MATCHES "set\\(TEST_OPTIONAL \"TEST_OPTIONAL-NOTFOUND\".+\\)")
+ set(RunCMake_TEST_FAILED "Cannot find TEST_OPTIONAL argument in cache")
+ return()
+endif()
+if("${CMAKE_MATCH_0}" MATCHES FORCE)
+ set(RunCMake_TEST_FAILED "Expected not forced TEST_OPTIONAL argument")
+ return()
+endif()