summaryrefslogtreecommitdiffstats
path: root/Source/cmSubdirCommand.cxx
diff options
context:
space:
mode:
authorPavel Solodovnikov <hellyeahdominate@gmail.com>2017-09-11 10:40:26 (GMT)
committerPavel Solodovnikov <hellyeahdominate@gmail.com>2017-09-12 13:22:47 (GMT)
commit7d5095796ab616cf9b709036387bb95ab9984141 (patch)
treec010e922adad95ef86ab4a3ac2a3abd63e9f33ef /Source/cmSubdirCommand.cxx
parent00975e926199eea21763470e2ab876246e36669a (diff)
downloadCMake-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/cmSubdirCommand.cxx')
-rw-r--r--Source/cmSubdirCommand.cxx19
1 files changed, 9 insertions, 10 deletions
diff --git a/Source/cmSubdirCommand.cxx b/Source/cmSubdirCommand.cxx
index 3727dfa..c74ca59 100644
--- a/Source/cmSubdirCommand.cxx
+++ b/Source/cmSubdirCommand.cxx
@@ -18,36 +18,35 @@ bool cmSubdirCommand::InitialPass(std::vector<std::string> const& args,
bool res = true;
bool excludeFromAll = false;
- for (std::vector<std::string>::const_iterator i = args.begin();
- i != args.end(); ++i) {
- if (*i == "EXCLUDE_FROM_ALL") {
+ for (std::string const& i : args) {
+ if (i == "EXCLUDE_FROM_ALL") {
excludeFromAll = true;
continue;
}
- if (*i == "PREORDER") {
+ if (i == "PREORDER") {
// Ignored
continue;
}
// if they specified a relative path then compute the full
std::string srcPath =
- std::string(this->Makefile->GetCurrentSourceDirectory()) + "/" + *i;
+ std::string(this->Makefile->GetCurrentSourceDirectory()) + "/" + i;
if (cmSystemTools::FileIsDirectory(srcPath)) {
std::string binPath =
- std::string(this->Makefile->GetCurrentBinaryDirectory()) + "/" + *i;
+ std::string(this->Makefile->GetCurrentBinaryDirectory()) + "/" + i;
this->Makefile->AddSubDirectory(srcPath, binPath, excludeFromAll, false);
}
// otherwise it is a full path
- else if (cmSystemTools::FileIsDirectory(*i)) {
+ else if (cmSystemTools::FileIsDirectory(i)) {
// we must compute the binPath from the srcPath, we just take the last
// element from the source path and use that
std::string binPath =
std::string(this->Makefile->GetCurrentBinaryDirectory()) + "/" +
- cmSystemTools::GetFilenameName(*i);
- this->Makefile->AddSubDirectory(*i, binPath, excludeFromAll, false);
+ cmSystemTools::GetFilenameName(i);
+ this->Makefile->AddSubDirectory(i, binPath, excludeFromAll, false);
} else {
std::string error = "Incorrect SUBDIRS command. Directory: ";
- error += *i + " does not exist.";
+ error += i + " does not exist.";
this->SetError(error);
res = false;
}