diff options
author | Brad King <brad.king@kitware.com> | 2018-03-12 17:49:39 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-03-12 17:49:44 (GMT) |
commit | 83071fff759f27f18922df8336826f19518e730c (patch) | |
tree | 0e0bb11ee0316418ce4cd85f4676744c430e345b /Tests | |
parent | 378a11cdbad6732971e91d5999f5788e26e35438 (diff) | |
parent | 7ad981c8f705ef563b8ca0bf3da98f6902fa56fe (diff) | |
download | CMake-83071fff759f27f18922df8336826f19518e730c.zip CMake-83071fff759f27f18922df8336826f19518e730c.tar.gz CMake-83071fff759f27f18922df8336826f19518e730c.tar.bz2 |
Merge topic 'ep-support-passing-var-ending-with-notfound'
7ad981c8f7 ExternalProject: Fix cache generation when last args ends with "-NOTFOUND"
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1838
Diffstat (limited to 'Tests')
4 files changed, 22 insertions, 2 deletions
diff --git a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS-check.cmake b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS-check.cmake index cb48be7..cc5521e 100644 --- a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS-check.cmake +++ b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS-check.cmake @@ -24,3 +24,12 @@ if(NOT "${CMAKE_MATCH_0}" MATCHES FORCE) set(RunCMake_TEST_FAILED "Expected 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(NOT "${CMAKE_MATCH_0}" MATCHES FORCE) + set(RunCMake_TEST_FAILED "Expected forced TEST_OPTIONAL argument") + return() +endif() diff --git a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS.cmake b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS.cmake index dcb992d..a583e31 100644 --- a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS.cmake +++ b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS.cmake @@ -8,4 +8,5 @@ ExternalProject_Add(FOO TMP_DIR "${CMAKE_CURRENT_BINARY_DIR}/tmp" DOWNLOAD_COMMAND "" CMAKE_CACHE_ARGS "-DFOO:STRING=$<1:BAR>$<0:BAD>" - "-DTEST_LIST:STRING=A;B;C") + "-DTEST_LIST:STRING=A;B;C" + "-DTEST_OPTIONAL:FILEPATH=TEST_OPTIONAL-NOTFOUND") diff --git a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS-check.cmake b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS-check.cmake index c84932d..2bef56e 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() diff --git a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS.cmake b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS.cmake index 4b4b40e..d388315 100644 --- a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS.cmake +++ b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS.cmake @@ -8,4 +8,5 @@ ExternalProject_Add(FOO TMP_DIR "${CMAKE_CURRENT_BINARY_DIR}/tmp" DOWNLOAD_COMMAND "" CMAKE_CACHE_DEFAULT_ARGS "-DFOO:STRING=$<1:BAR>$<0:BAD>" - "-DTEST_LIST:STRING=A;B;C") + "-DTEST_LIST:STRING=A;B;C" + "-DTEST_OPTIONAL:FILEPATH=TEST_OPTIONAL-NOTFOUND") |