diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-07-19 14:33:54 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-08-24 18:05:37 (GMT) |
commit | 6c832219eadb6062c5026817ed86b81e583c8e5d (patch) | |
tree | 61e5e044e921da2bd1e854d559beb4f1e47e259d | |
parent | 3fcf383763e80b90e30fa06b29e0751ca19ab983 (diff) | |
download | CMake-6c832219eadb6062c5026817ed86b81e583c8e5d.zip CMake-6c832219eadb6062c5026817ed86b81e583c8e5d.tar.gz CMake-6c832219eadb6062c5026817ed86b81e583c8e5d.tar.bz2 |
cmLocalGenerator: Implement child traversal in terms of cmState.
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.cxx | 8 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 19 |
2 files changed, 16 insertions, 11 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index d951c13..fd7c768 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -495,10 +495,12 @@ cmGlobalUnixMakefileGenerator3 // The directory-level rule should depend on the directory-level // rules of the subdirectories. - for(std::vector<cmLocalGenerator*>::iterator sdi = - lg->GetChildren().begin(); sdi != lg->GetChildren().end(); ++sdi) + std::vector<cmState::Snapshot> children + = lg->GetMakefile()->GetStateSnapshot().GetChildren(); + for(std::vector<cmState::Snapshot>::const_iterator + ci = children.begin(); ci != children.end(); ++ci) { - std::string subdir = (*sdi)->GetMakefile()->GetCurrentBinaryDirectory(); + std::string subdir = ci->GetDirectory().GetCurrentBinary(); subdir += "/"; subdir += pass; depends.push_back(subdir); diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index db464d6..9344f1d 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -200,12 +200,13 @@ void cmLocalGenerator::GenerateTestFiles() (*gi)->Generate(fout, config, configurationTypes); } size_t i; - for(i = 0; i < this->Children.size(); ++i) + std::vector<cmState::Snapshot> children + = this->Makefile->GetStateSnapshot().GetChildren(); + for(i = 0; i < children.size(); ++i) { // TODO: Use add_subdirectory instead? fout << "subdirs("; - std::string outP = - this->Children[i]->GetMakefile()->GetCurrentBinaryDirectory(); + std::string outP = children[i].GetDirectory().GetCurrentBinary(); fout << this->Convert(outP,START_OUTPUT); fout << ")" << std::endl; } @@ -413,16 +414,18 @@ void cmLocalGenerator::GenerateInstallRules() this->GenerateTargetInstallRules(fout, config, configurationTypes); // Include install scripts from subdirectories. - if(!this->Children.empty()) + std::vector<cmState::Snapshot> children + = this->Makefile->GetStateSnapshot().GetChildren(); + if(!children.empty()) { fout << "if(NOT CMAKE_INSTALL_LOCAL_ONLY)\n"; fout << " # Include the install script for each subdirectory.\n"; - for(std::vector<cmLocalGenerator*>::const_iterator - ci = this->Children.begin(); ci != this->Children.end(); ++ci) + for(std::vector<cmState::Snapshot>::const_iterator + ci = children.begin(); ci != children.end(); ++ci) { - if(!(*ci)->GetMakefile()->GetPropertyAsBool("EXCLUDE_FROM_ALL")) + if(!ci->GetDirectory().GetPropertyAsBool("EXCLUDE_FROM_ALL")) { - std::string odir = (*ci)->GetMakefile()->GetCurrentBinaryDirectory(); + std::string odir = ci->GetDirectory().GetCurrentBinary(); cmSystemTools::ConvertToUnixSlashes(odir); fout << " include(\"" << odir << "/cmake_install.cmake\")" << std::endl; |