summaryrefslogtreecommitdiff
path: root/Source/cmExportCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmExportCommand.cxx')
-rw-r--r--Source/cmExportCommand.cxx24
1 files changed, 10 insertions, 14 deletions
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx
index 64baa90776..9913129834 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);