[Cmake-commits] CMake branch, master, updated. v3.11.3-907-g21b7e14
Kitware Robot
kwrobot at kitware.com
Tue Jun 5 11:25:07 EDT 2018
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, master has been updated
via 21b7e1480056ba9a057ff15573fe22ad8decc2e0 (commit)
via 7ad5165c675d23e9d3f8c076b7cb32a2618e7e96 (commit)
from f790273ef0fb33145ceb9d5a19c22c56be76a023 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=21b7e1480056ba9a057ff15573fe22ad8decc2e0
commit 21b7e1480056ba9a057ff15573fe22ad8decc2e0
Merge: f790273 7ad5165
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Jun 5 15:23:22 2018 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Jun 5 11:23:49 2018 -0400
Merge topic 'ep-support-passing-var-ending-with-notfound'
7ad5165c67 ExternalProject: Fix cache generation when args end with "-NOTFOUND"
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !2127
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7ad5165c675d23e9d3f8c076b7cb32a2618e7e96
commit 7ad5165c675d23e9d3f8c076b7cb32a2618e7e96
Author: Jean-Christophe Fillion-Robin <jchris.fillionr at kitware.com>
AuthorDate: Fri Jun 1 18:43:45 2018 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Jun 4 11:37:52 2018 -0400
ExternalProject: Fix cache generation when args end with "-NOTFOUND"
Generalize the fix in commit v3.11.0-rc4~8^2 (ExternalProject: Fix cache
generation when last args ends with "-NOTFOUND", 2018-03-10) to work for
any argument rather than just the last one.
ExternalProject can now successfully generate the cache file when any
(not only the last one) cache variable associated with either
`CMAKE_CACHE_ARGS` or `CMAKE_DEFAULT_CACHE_ARGS` configure step option
is set to a `<value>` ending with `-NOTFOUND`.
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index db19691..0a1c0c0 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -1686,7 +1686,7 @@ function(_ep_command_line_to_initial_cache var args force)
foreach(line ${args})
if("${line}" MATCHES "^-D(.*)")
set(line "${CMAKE_MATCH_1}")
- if(setArg)
+ if(NOT "${setArg}" STREQUAL "")
# This is required to build up lists in variables, or complete an entry
string(APPEND setArg "${accumulator}\" CACHE ${type} \"Initial cache\" ${forceArg})")
string(APPEND script_initial_cache "\n${setArg}")
diff --git a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS-check.cmake b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS-check.cmake
index cc5521e..c501856 100644
--- a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS-check.cmake
+++ b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS-check.cmake
@@ -33,3 +33,12 @@ if(NOT "${CMAKE_MATCH_0}" MATCHES FORCE)
set(RunCMake_TEST_FAILED "Expected forced TEST_OPTIONAL argument")
return()
endif()
+
+if(NOT "${_cache}" MATCHES "set\\(TEST_OPTIONAL_LAST \"TEST_OPTIONAL_LAST-NOTFOUND\".+\\)")
+ set(RunCMake_TEST_FAILED "Cannot find TEST_OPTIONAL_LAST argument in cache")
+ return()
+endif()
+if(NOT "${CMAKE_MATCH_0}" MATCHES FORCE)
+ set(RunCMake_TEST_FAILED "Expected forced TEST_OPTIONAL_LAST argument")
+ return()
+endif()
diff --git a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS.cmake b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS.cmake
index a583e31..4f7e020 100644
--- a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS.cmake
+++ b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS.cmake
@@ -9,4 +9,5 @@ ExternalProject_Add(FOO TMP_DIR "${CMAKE_CURRENT_BINARY_DIR}/tmp"
CMAKE_CACHE_ARGS
"-DFOO:STRING=$<1:BAR>$<0:BAD>"
"-DTEST_LIST:STRING=A;B;C"
- "-DTEST_OPTIONAL:FILEPATH=TEST_OPTIONAL-NOTFOUND")
+ "-DTEST_OPTIONAL:FILEPATH=TEST_OPTIONAL-NOTFOUND"
+ "-DTEST_OPTIONAL_LAST:FILEPATH=TEST_OPTIONAL_LAST-NOTFOUND")
diff --git a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS-check.cmake b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS-check.cmake
index 2bef56e..059f6d3 100644
--- a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS-check.cmake
+++ b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS-check.cmake
@@ -33,3 +33,12 @@ if("${CMAKE_MATCH_0}" MATCHES FORCE)
set(RunCMake_TEST_FAILED "Expected not forced TEST_OPTIONAL argument")
return()
endif()
+
+if(NOT "${_cache}" MATCHES "set\\(TEST_OPTIONAL_LAST \"TEST_OPTIONAL_LAST-NOTFOUND\".+\\)")
+ set(RunCMake_TEST_FAILED "Cannot find TEST_OPTIONAL_LAST argument in cache")
+ return()
+endif()
+if("${CMAKE_MATCH_0}" MATCHES FORCE)
+ set(RunCMake_TEST_FAILED "Expected not forced TEST_OPTIONAL_LAST argument")
+ return()
+endif()
diff --git a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS.cmake b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS.cmake
index d388315..6133418 100644
--- a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS.cmake
+++ b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS.cmake
@@ -9,4 +9,5 @@ ExternalProject_Add(FOO TMP_DIR "${CMAKE_CURRENT_BINARY_DIR}/tmp"
CMAKE_CACHE_DEFAULT_ARGS
"-DFOO:STRING=$<1:BAR>$<0:BAD>"
"-DTEST_LIST:STRING=A;B;C"
- "-DTEST_OPTIONAL:FILEPATH=TEST_OPTIONAL-NOTFOUND")
+ "-DTEST_OPTIONAL:FILEPATH=TEST_OPTIONAL-NOTFOUND"
+ "-DTEST_OPTIONAL_LAST:FILEPATH=TEST_OPTIONAL_LAST-NOTFOUND")
-----------------------------------------------------------------------
Summary of changes:
Modules/ExternalProject.cmake | 2 +-
Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS-check.cmake | 9 +++++++++
Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS.cmake | 3 ++-
.../ExternalProject/CMAKE_CACHE_DEFAULT_ARGS-check.cmake | 9 +++++++++
Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS.cmake | 3 ++-
5 files changed, 23 insertions(+), 3 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list