diff options
author | Brad King <brad.king@kitware.com> | 2015-08-27 14:04:07 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-08-27 14:04:07 (GMT) |
commit | 6904b6efdc2ea35c3490ba33cb352b03ea3085f5 (patch) | |
tree | 1108c7e561412f01acf5bfa744d526a8656ee47b /Source/cmLocalGenerator.cxx | |
parent | a97bb6ae3f70febd207ef2373287237249f082e5 (diff) | |
parent | 867b5be8b89c9b4f18ea604e1c61a154d0335c4c (diff) | |
download | CMake-6904b6efdc2ea35c3490ba33cb352b03ea3085f5.zip CMake-6904b6efdc2ea35c3490ba33cb352b03ea3085f5.tar.gz CMake-6904b6efdc2ea35c3490ba33cb352b03ea3085f5.tar.bz2 |
Merge topic 'rm-cmLocalGenerator-Children'
867b5be8 cmLocalGenerator: Remove unused Children member.
6c832219 cmLocalGenerator: Implement child traversal in terms of cmState.
3fcf3837 Makefiles: Remove valueless cast.
223f4a66 cmLocalGenerator: Simplify condition.
ae026f54 cmState: Store Children states in parent state.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index c2d1a7d..1e8fd3e 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -50,10 +50,6 @@ cmLocalGenerator::cmLocalGenerator(cmGlobalGenerator* gg, assert(snapshot.IsValid()); this->GlobalGenerator = gg; this->Parent = parent; - if (parent) - { - parent->AddChild(this); - } this->Makefile = new cmMakefile(this); @@ -199,18 +195,16 @@ void cmLocalGenerator::GenerateTestFiles() (*gi)->Compute(this); (*gi)->Generate(fout, config, configurationTypes); } - if (!this->Children.empty()) + size_t i; + std::vector<cmState::Snapshot> children + = this->Makefile->GetStateSnapshot().GetChildren(); + for(i = 0; i < children.size(); ++i) { - size_t i; - for(i = 0; i < this->Children.size(); ++i) - { - // TODO: Use add_subdirectory instead? - fout << "subdirs("; - std::string outP = - this->Children[i]->GetMakefile()->GetCurrentBinaryDirectory(); - fout << this->Convert(outP,START_OUTPUT); - fout << ")" << std::endl; - } + // TODO: Use add_subdirectory instead? + fout << "subdirs("; + std::string outP = children[i].GetDirectory().GetCurrentBinary(); + fout << this->Convert(outP,START_OUTPUT); + fout << ")" << std::endl; } } @@ -416,16 +410,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; |