summaryrefslogtreecommitdiff
path: root/Source/cmSetPropertyCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmSetPropertyCommand.cxx')
-rw-r--r--Source/cmSetPropertyCommand.cxx37
1 files changed, 16 insertions, 21 deletions
diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx
index 338fceaa4f..7efcc0403f 100644
--- a/Source/cmSetPropertyCommand.cxx
+++ b/Source/cmSetPropertyCommand.cxx
@@ -204,20 +204,19 @@ bool cmSetPropertyCommand::HandleDirectoryMode()
bool cmSetPropertyCommand::HandleTargetMode()
{
- for (std::set<std::string>::const_iterator ni = this->Names.begin();
- ni != this->Names.end(); ++ni) {
- if (this->Makefile->IsAlias(*ni)) {
+ for (std::string const& name : this->Names) {
+ if (this->Makefile->IsAlias(name)) {
this->SetError("can not be used on an ALIAS target.");
return false;
}
- if (cmTarget* target = this->Makefile->FindTargetToUse(*ni)) {
+ if (cmTarget* target = this->Makefile->FindTargetToUse(name)) {
// Handle the current target.
if (!this->HandleTarget(target)) {
return false;
}
} else {
std::ostringstream e;
- e << "could not find TARGET " << *ni
+ e << "could not find TARGET " << name
<< ". Perhaps it has not yet been created.";
this->SetError(e.str());
return false;
@@ -248,16 +247,15 @@ bool cmSetPropertyCommand::HandleTarget(cmTarget* target)
bool cmSetPropertyCommand::HandleSourceMode()
{
- for (std::set<std::string>::const_iterator ni = this->Names.begin();
- ni != this->Names.end(); ++ni) {
+ for (std::string const& name : this->Names) {
// Get the source file.
- if (cmSourceFile* sf = this->Makefile->GetOrCreateSource(*ni)) {
+ if (cmSourceFile* sf = this->Makefile->GetOrCreateSource(name)) {
if (!this->HandleSource(sf)) {
return false;
}
} else {
std::ostringstream e;
- e << "given SOURCE name that could not be found or created: " << *ni;
+ e << "given SOURCE name that could not be found or created: " << name;
this->SetError(e.str());
return false;
}
@@ -303,9 +301,8 @@ bool cmSetPropertyCommand::HandleTestMode()
if (!this->Names.empty()) {
std::ostringstream e;
e << "given TEST names that do not exist:\n";
- for (std::set<std::string>::const_iterator ni = this->Names.begin();
- ni != this->Names.end(); ++ni) {
- e << " " << *ni << "\n";
+ for (std::string const& name : this->Names) {
+ e << " " << name << "\n";
}
this->SetError(e.str());
return false;
@@ -359,19 +356,18 @@ bool cmSetPropertyCommand::HandleCacheMode()
return false;
}
- for (std::set<std::string>::const_iterator ni = this->Names.begin();
- ni != this->Names.end(); ++ni) {
+ for (std::string const& name : this->Names) {
// Get the source file.
cmMakefile* mf = this->GetMakefile();
cmake* cm = mf->GetCMakeInstance();
- const char* existingValue = cm->GetState()->GetCacheEntryValue(*ni);
+ const char* existingValue = cm->GetState()->GetCacheEntryValue(name);
if (existingValue) {
- if (!this->HandleCacheEntry(*ni)) {
+ if (!this->HandleCacheEntry(name)) {
return false;
}
} else {
std::ostringstream e;
- e << "could not find CACHE variable " << *ni
+ e << "could not find CACHE variable " << name
<< ". Perhaps it has not yet been created.";
this->SetError(e.str());
return false;
@@ -403,16 +399,15 @@ bool cmSetPropertyCommand::HandleInstallMode()
{
cmake* cm = this->Makefile->GetCMakeInstance();
- for (std::set<std::string>::const_iterator i = this->Names.begin();
- i != this->Names.end(); ++i) {
+ for (std::string const& name : this->Names) {
if (cmInstalledFile* file =
- cm->GetOrCreateInstalledFile(this->Makefile, *i)) {
+ cm->GetOrCreateInstalledFile(this->Makefile, name)) {
if (!this->HandleInstall(file)) {
return false;
}
} else {
std::ostringstream e;
- e << "given INSTALL name that could not be found or created: " << *i;
+ e << "given INSTALL name that could not be found or created: " << name;
this->SetError(e.str());
return false;
}