summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2005-01-21 17:26:32 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2005-01-21 17:26:32 (GMT)
commit13865fc4fae3806c1359e17e60b7032edc379026 (patch)
tree00a008367d2e67dfbd1eefd09d196f980bc03dc0 /Source/cmGlobalGenerator.cxx
parent35c33d0e2df8646c67125dde4c8b05267388f73c (diff)
downloadCMake-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.cxx24
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]);
+ }
+ }
+
+}