diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2005-01-21 17:26:32 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2005-01-21 17:26:32 (GMT) |
commit | 13865fc4fae3806c1359e17e60b7032edc379026 (patch) | |
tree | 00a008367d2e67dfbd1eefd09d196f980bc03dc0 /Source/cmGlobalGenerator.cxx | |
parent | 35c33d0e2df8646c67125dde4c8b05267388f73c (diff) | |
download | CMake-13865fc4fae3806c1359e17e60b7032edc379026.zip CMake-13865fc4fae3806c1359e17e60b7032edc379026.tar.gz CMake-13865fc4fae3806c1359e17e60b7032edc379026.tar.bz2 |
ENH: move project map to global generator base
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 753221d..396d76e 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -554,6 +554,9 @@ void cmGlobalGenerator::Configure() "Please set the following variables:\n", notFoundVars.c_str()); } + // at this point m_LocalGenerators has been filled, + // so create the map from project name to vector of local generators + this->FillProjectMap(); if ( !m_CMakeInstance->GetScriptMode() ) { m_CMakeInstance->UpdateProgress("Configuring done", -1); @@ -774,3 +777,24 @@ const char* cmGlobalGenerator::GetLinkerPreference(const char* lang) } return "None"; } + + +void cmGlobalGenerator::FillProjectMap() +{ + unsigned int i; + for(i = 0; i < m_LocalGenerators.size(); ++i) + { + std::string name = m_LocalGenerators[i]->GetMakefile()->GetProjectName(); + // for each local generator add the local generator to the project that + // it is in + m_ProjectMap[name].push_back(m_LocalGenerators[i]); + // now add the local generator to any parent project it is part of + std::vector<std::string> const& pprojects + = m_LocalGenerators[i]->GetMakefile()->GetParentProjects(); + for(unsigned int k =0; k < pprojects.size(); ++k) + { + m_ProjectMap[pprojects[k]].push_back(m_LocalGenerators[i]); + } + } + +} |