summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-01-23 15:02:18 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-01-23 15:02:44 (GMT)
commit74588925229cb4b3df319fd084c2481c2f962fbc (patch)
tree80c1dd5b315acee5724a38c6a1f4c7e7e053715d
parent70adbc0c3ef563627e7843d2ffbe2b341c0f561e (diff)
parent4c8a917a8771a64cfa0a8931824307e7f371b904 (diff)
downloadCMake-74588925229cb4b3df319fd084c2481c2f962fbc.zip
CMake-74588925229cb4b3df319fd084c2481c2f962fbc.tar.gz
CMake-74588925229cb4b3df319fd084c2481c2f962fbc.tar.bz2
Merge topic 'get-runtime-dependencies-keyword-args' into release-3.16
4c8a917a87 file(GET_RUNTIME_DEPENDENCIES): Tolerate empty list arguments Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4262
-rw-r--r--Source/cmFileCommand.cxx17
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt7
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake15
3 files changed, 34 insertions, 5 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index d55b959..d45414f 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -2673,9 +2673,20 @@ bool HandleGetRuntimeDependenciesCommand(std::vector<std::string> const& args,
cmSystemTools::SetFatalErrorOccured();
return false;
}
- argIt = keywordsMissingValues.begin();
- if (argIt != keywordsMissingValues.end()) {
- status.SetError(cmStrCat("Keyword missing value: ", *argIt));
+
+ const std::vector<std::string> LIST_ARGS = { "DIRECTORIES",
+ "EXECUTABLES",
+ "LIBRARIES",
+ "MODULES",
+ "POST_EXCLUDE_REGEXES",
+ "POST_INCLUDE_REGEXES",
+ "PRE_EXCLUDE_REGEXES",
+ "PRE_INCLUDE_REGEXES" };
+ auto kwbegin = keywordsMissingValues.cbegin();
+ auto kwend = cmRemoveMatching(keywordsMissingValues, LIST_ARGS);
+ if (kwend != kwbegin) {
+ status.SetError(cmStrCat("Keywords missing values:\n ",
+ cmJoin(cmMakeRange(kwbegin, kwend), "\n ")));
cmSystemTools::SetFatalErrorOccured();
return false;
}
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt
index 94f0f46..50fa81f 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt
@@ -13,6 +13,11 @@ Call Stack \(most recent call first\):
This warning is for project developers\. Use -Wno-dev to suppress it\.
CMake Error at file-GET_RUNTIME_DEPENDENCIES-badargs2\.cmake:[0-9]+ \(file\):
- file Keyword missing value: BUNDLE_EXECUTABLE
+ file Keywords missing values:
+
+ RESOLVED_DEPENDENCIES_VAR
+ UNRESOLVED_DEPENDENCIES_VAR
+ CONFLICTING_DEPENDENCIES_PREFIX
+ BUNDLE_EXECUTABLE
Call Stack \(most recent call first\):
CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake
index 138ab95..ac6af85 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake
@@ -1,2 +1,15 @@
-file(GET_RUNTIME_DEPENDENCIES BUNDLE_EXECUTABLE)
+file(GET_RUNTIME_DEPENDENCIES
+ RESOLVED_DEPENDENCIES_VAR
+ UNRESOLVED_DEPENDENCIES_VAR
+ CONFLICTING_DEPENDENCIES_PREFIX
+ BUNDLE_EXECUTABLE
+ EXECUTABLES
+ LIBRARIES
+ MODULES
+ DIRECTORIES
+ PRE_INCLUDE_REGEXES
+ PRE_EXCLUDE_REGEXES
+ POST_INCLUDE_REGEXES
+ POST_EXCLUDE_REGEXES
+ )
message(FATAL_ERROR "This message should not be displayed")