summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-06-22 13:42:07 (GMT)
committerBrad King <brad.king@kitware.com>2018-06-22 13:42:07 (GMT)
commit221f8aa7e28eadcc7541e16d0b5dbaa243ba7829 (patch)
tree298376f7efb9426eedde9f8330b1db8c09a98343 /Source
parent5dc9f440c5c368ce67de52130a845bb5a5089a0e (diff)
parent142a6257294afbfdf86ec13fdb4ecf303b131f99 (diff)
downloadCMake-221f8aa7e28eadcc7541e16d0b5dbaa243ba7829.zip
CMake-221f8aa7e28eadcc7541e16d0b5dbaa243ba7829.tar.gz
CMake-221f8aa7e28eadcc7541e16d0b5dbaa243ba7829.tar.bz2
Merge branch 'file-GLOB-remove-new-errors' into release-3.12
Merge-request: !2164
Diffstat (limited to 'Source')
-rw-r--r--Source/cmFileCommand.cxx28
1 files changed, 11 insertions, 17 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index aae70b1..dcb79f7 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -777,7 +777,7 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args,
this->Makefile->GetCMakeInstance()->GetWorkingMode();
while (i != args.end()) {
if (*i == "LIST_DIRECTORIES") {
- ++i;
+ ++i; // skip LIST_DIRECTORIES
if (i != args.end()) {
if (cmSystemTools::IsOn(i->c_str())) {
g.SetListDirs(true);
@@ -789,27 +789,21 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args,
this->SetError("LIST_DIRECTORIES missing bool value.");
return false;
}
+ ++i;
} else {
this->SetError("LIST_DIRECTORIES missing bool value.");
return false;
}
- ++i;
- if (i == args.end()) {
- this->SetError("GLOB requires a glob expression after the bool.");
- return false;
- }
} else if (*i == "FOLLOW_SYMLINKS") {
- if (!recurse) {
- this->SetError("FOLLOW_SYMLINKS is not a valid parameter for GLOB.");
- return false;
- }
- explicitFollowSymlinks = true;
- g.RecurseThroughSymlinksOn();
- ++i;
- if (i == args.end()) {
- this->SetError(
- "GLOB_RECURSE requires a glob expression after FOLLOW_SYMLINKS.");
- return false;
+ ++i; // skip FOLLOW_SYMLINKS
+ if (recurse) {
+ explicitFollowSymlinks = true;
+ g.RecurseThroughSymlinksOn();
+ if (i == args.end()) {
+ this->SetError(
+ "GLOB_RECURSE requires a glob expression after FOLLOW_SYMLINKS.");
+ return false;
+ }
}
} else if (*i == "RELATIVE") {
++i; // skip RELATIVE