diff options
Diffstat (limited to 'Source/cmAddSubDirectoryCommand.cxx')
-rw-r--r-- | Source/cmAddSubDirectoryCommand.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx index 75e5aa4..7947188 100644 --- a/Source/cmAddSubDirectoryCommand.cxx +++ b/Source/cmAddSubDirectoryCommand.cxx @@ -6,6 +6,7 @@ #include <string.h> #include "cmMakefile.h" +#include "cmRange.h" #include "cmSystemTools.h" class cmExecutionStatus; @@ -26,15 +27,13 @@ bool cmAddSubDirectoryCommand::InitialPass( bool excludeFromAll = false; // process the rest of the arguments looking for optional args - std::vector<std::string>::const_iterator i = args.begin(); - ++i; - for (; i != args.end(); ++i) { - if (*i == "EXCLUDE_FROM_ALL") { + for (std::string const& arg : cmMakeRange(args).advance(1)) { + if (arg == "EXCLUDE_FROM_ALL") { excludeFromAll = true; continue; } if (binArg.empty()) { - binArg = *i; + binArg = arg; } else { this->SetError("called with incorrect number of arguments"); return false; |