summaryrefslogtreecommitdiffstats
path: root/Source/cmFileCommand.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-01-22 18:05:46 (GMT)
committerBrad King <brad.king@kitware.com>2020-01-22 19:34:33 (GMT)
commitc998c8d56079edbc5834ba472c5bff7242bc7418 (patch)
tree32c0e42d80ad126b7072b2ed2293ce480ed3fa6b /Source/cmFileCommand.cxx
parent593d0f3a578a51775d6402064ec53dce42b4d82c (diff)
downloadCMake-c998c8d56079edbc5834ba472c5bff7242bc7418.zip
CMake-c998c8d56079edbc5834ba472c5bff7242bc7418.tar.gz
CMake-c998c8d56079edbc5834ba472c5bff7242bc7418.tar.bz2
file(GET_RUNTIME_DEPENDENCIES): Tolerate empty list arguments
Also list all keywords that were missing values instead of only the first one.
Diffstat (limited to 'Source/cmFileCommand.cxx')
-rw-r--r--Source/cmFileCommand.cxx18
1 files changed, 15 insertions, 3 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index d1775a7..79110ab 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -25,6 +25,7 @@
#include "cm_static_string_view.hxx"
#include "cm_sys_stat.h"
+#include "cmAlgorithms.h"
#include "cmArgumentParser.h"
#include "cmCryptoHash.h"
#include "cmExecutionStatus.h"
@@ -2674,9 +2675,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;
}