summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
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]);
+ }
+ }
+
+}