summaryrefslogtreecommitdiffstats
path: root/Source/cmListCommand.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2018-10-11 21:22:45 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2018-10-11 21:33:45 (GMT)
commitbf572ac952d7ddf2b7208efc56f104844aea72e2 (patch)
tree912f1cf7ea09520a5762f8253c883d3f3a62c8f8 /Source/cmListCommand.cxx
parente2dd6ac9776e4f5a1995dfc606480b627fdbce72 (diff)
downloadCMake-bf572ac952d7ddf2b7208efc56f104844aea72e2.zip
CMake-bf572ac952d7ddf2b7208efc56f104844aea72e2.tar.gz
CMake-bf572ac952d7ddf2b7208efc56f104844aea72e2.tar.bz2
cmListCommand: check list(FILTER) operation before the list
A future commit will make the not-a-list case a success, but invalid operations should still be diagnosed in that case.
Diffstat (limited to 'Source/cmListCommand.cxx')
-rw-r--r--Source/cmListCommand.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx
index d7de2fa..b9c7ada 100644
--- a/Source/cmListCommand.cxx
+++ b/Source/cmListCommand.cxx
@@ -1289,14 +1289,6 @@ bool cmListCommand::HandleFilterCommand(std::vector<std::string> const& args)
return false;
}
- const std::string& listName = args[1];
- // expand the variable
- std::vector<std::string> varArgsExpanded;
- if (!this->GetList(varArgsExpanded, listName)) {
- this->SetError("sub-command FILTER requires list to be present.");
- return false;
- }
-
const std::string& op = args[2];
bool includeMatches;
if (op == "INCLUDE") {
@@ -1308,6 +1300,14 @@ bool cmListCommand::HandleFilterCommand(std::vector<std::string> const& args)
return false;
}
+ const std::string& listName = args[1];
+ // expand the variable
+ std::vector<std::string> varArgsExpanded;
+ if (!this->GetList(varArgsExpanded, listName)) {
+ this->SetError("sub-command FILTER requires list to be present.");
+ return false;
+ }
+
const std::string& mode = args[3];
if (mode == "REGEX") {
if (args.size() != 5) {