diff options
author | Pavel Solodovnikov <hellyeahdominate@gmail.com> | 2017-09-11 10:40:26 (GMT) |
---|---|---|
committer | Pavel Solodovnikov <hellyeahdominate@gmail.com> | 2017-09-12 13:22:47 (GMT) |
commit | 7d5095796ab616cf9b709036387bb95ab9984141 (patch) | |
tree | c010e922adad95ef86ab4a3ac2a3abd63e9f33ef /Source/cmExportCommand.cxx | |
parent | 00975e926199eea21763470e2ab876246e36669a (diff) | |
download | CMake-7d5095796ab616cf9b709036387bb95ab9984141.zip CMake-7d5095796ab616cf9b709036387bb95ab9984141.tar.gz CMake-7d5095796ab616cf9b709036387bb95ab9984141.tar.bz2 |
Meta: modernize old-fashioned loops to range-based `for`.
Changes done via `clang-tidy` with some manual fine-tuning
for the variable naming and `auto` type deduction
where appropriate.
Diffstat (limited to 'Source/cmExportCommand.cxx')
-rw-r--r-- | Source/cmExportCommand.cxx | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx index 64baa90..9913129 100644 --- a/Source/cmExportCommand.cxx +++ b/Source/cmExportCommand.cxx @@ -136,42 +136,40 @@ bool cmExportCommand::InitialPass(std::vector<std::string> const& args, } this->ExportSet = setMap[setName]; } else if (this->Targets.WasFound()) { - for (std::vector<std::string>::const_iterator currentTarget = - this->Targets.GetVector().begin(); - currentTarget != this->Targets.GetVector().end(); ++currentTarget) { - if (this->Makefile->IsAlias(*currentTarget)) { + for (std::string const& currentTarget : this->Targets.GetVector()) { + if (this->Makefile->IsAlias(currentTarget)) { std::ostringstream e; - e << "given ALIAS target \"" << *currentTarget + e << "given ALIAS target \"" << currentTarget << "\" which may not be exported."; this->SetError(e.str()); return false; } - if (cmTarget* target = gg->FindTarget(*currentTarget)) { + if (cmTarget* target = gg->FindTarget(currentTarget)) { if (target->GetType() == cmStateEnums::OBJECT_LIBRARY) { std::string reason; if (!this->Makefile->GetGlobalGenerator() ->HasKnownObjectFileLocation(&reason)) { std::ostringstream e; - e << "given OBJECT library \"" << *currentTarget + e << "given OBJECT library \"" << currentTarget << "\" which may not be exported" << reason << "."; this->SetError(e.str()); return false; } } if (target->GetType() == cmStateEnums::UTILITY) { - this->SetError("given custom target \"" + *currentTarget + + this->SetError("given custom target \"" + currentTarget + "\" which may not be exported."); return false; } } else { std::ostringstream e; - e << "given target \"" << *currentTarget + e << "given target \"" << currentTarget << "\" which is not built by this project."; this->SetError(e.str()); return false; } - targets.push_back(*currentTarget); + targets.push_back(currentTarget); } if (this->Append.IsEnabled()) { if (cmExportBuildFileGenerator* ebfg = @@ -209,10 +207,8 @@ bool cmExportCommand::InitialPass(std::vector<std::string> const& args, if (configurationTypes.empty()) { configurationTypes.push_back(""); } - for (std::vector<std::string>::const_iterator ci = - configurationTypes.begin(); - ci != configurationTypes.end(); ++ci) { - ebfg->AddConfiguration(*ci); + for (std::string const& ct : configurationTypes) { + ebfg->AddConfiguration(ct); } if (this->ExportSet) { gg->AddBuildExportExportSet(ebfg); |