diff options
Diffstat (limited to 'Source/cmAddCustomCommandCommand.cxx')
-rw-r--r-- | Source/cmAddCustomCommandCommand.cxx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx index bd054e816d..7fed52db50 100644 --- a/Source/cmAddCustomCommandCommand.cxx +++ b/Source/cmAddCustomCommandCommand.cxx @@ -68,9 +68,7 @@ bool cmAddCustomCommandCommand::InitialPass( tdoing doing = doing_nothing; - for (unsigned int j = 0; j < args.size(); ++j) { - std::string const& copy = args[j]; - + for (std::string const& copy : args) { if (copy == "SOURCE") { doing = doing_source; } else if (copy == "COMMAND") { @@ -355,12 +353,11 @@ bool cmAddCustomCommandCommand::InitialPass( bool cmAddCustomCommandCommand::CheckOutputs( const std::vector<std::string>& outputs) { - for (std::vector<std::string>::const_iterator o = outputs.begin(); - o != outputs.end(); ++o) { + for (std::string const& o : outputs) { // Make sure the file will not be generated into the source // directory during an out of source build. - if (!this->Makefile->CanIWriteThisFile(o->c_str())) { - std::string e = "attempted to have a file \"" + *o + + if (!this->Makefile->CanIWriteThisFile(o.c_str())) { + std::string e = "attempted to have a file \"" + o + "\" in a source directory as an output of custom command."; this->SetError(e); cmSystemTools::SetFatalErrorOccured(); @@ -368,10 +365,10 @@ bool cmAddCustomCommandCommand::CheckOutputs( } // Make sure the output file name has no invalid characters. - std::string::size_type pos = o->find_first_of("#<>"); + std::string::size_type pos = o.find_first_of("#<>"); if (pos != std::string::npos) { std::ostringstream msg; - msg << "called with OUTPUT containing a \"" << (*o)[pos] + msg << "called with OUTPUT containing a \"" << o[pos] << "\". This character is not allowed."; this->SetError(msg.str()); return false; |