summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorStefano Soffia <stefano.soffia.it@gmail.com>2016-09-12 21:01:50 (GMT)
committerBrad King <brad.king@kitware.com>2016-09-13 17:57:59 (GMT)
commit385e6a274da286befb38a0d540845383f393b79f (patch)
tree68001e25cdf765a7bd4aa2ce53d602ef65bff245 /Source/cmLocalGenerator.cxx
parent112f758223737464959a593084a357ba5d572e8b (diff)
downloadCMake-385e6a274da286befb38a0d540845383f393b79f.zip
CMake-385e6a274da286befb38a0d540845383f393b79f.tar.gz
CMake-385e6a274da286befb38a0d540845383f393b79f.tar.bz2
cmLocalGenerator: Refactor test subdirectory generation loop
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx14
1 files changed, 6 insertions, 8 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index c0ecba3..abe0c23 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -175,15 +175,13 @@ void cmLocalGenerator::GenerateTestFiles()
(*gi)->Compute(this);
(*gi)->Generate(fout, config, configurationTypes);
}
- size_t i;
- std::vector<cmState::Snapshot> children =
- this->Makefile->GetStateSnapshot().GetChildren();
- for (i = 0; i < children.size(); ++i) {
+ typedef std::vector<cmState::Snapshot> vec_t;
+ vec_t const& children = this->Makefile->GetStateSnapshot().GetChildren();
+ for (vec_t::const_iterator i = children.begin(); i != children.end(); ++i) {
// TODO: Use add_subdirectory instead?
- fout << "subdirs(";
- std::string outP = children[i].GetDirectory().GetCurrentBinary();
- fout << this->ConvertToRelativePath(outP, START_OUTPUT);
- fout << ")" << std::endl;
+ std::string outP = i->GetDirectory().GetCurrentBinary();
+ outP = this->ConvertToRelativePath(outP, START_OUTPUT);
+ fout << "subdirs(" << outP << ")" << std::endl;
}
}