Commit 69a038a9 authored by Stephen Kelly's avatar Stephen Kelly Committed by Brad King
Browse files

cmMakefile: Refactor directories specified with the subdirs command.

Store the directories on the cmMakefile as explicitly not-configured-yet.
parent 08637970
...@@ -119,18 +119,15 @@ void cmLocalGenerator::Configure() ...@@ -119,18 +119,15 @@ void cmLocalGenerator::Configure()
assert(cmSystemTools::FileExists(currentStart.c_str(), true)); assert(cmSystemTools::FileExists(currentStart.c_str(), true));
this->Makefile->ProcessBuildsystemFile(currentStart.c_str()); this->Makefile->ProcessBuildsystemFile(currentStart.c_str());
// at the end of the ReadListFile handle any old style subdirs // at the end handle any old style subdirs
// first get all the subdirectories std::vector<cmLocalGenerator *> subdirs =
std::vector<cmLocalGenerator *> subdirs = this->GetChildren(); this->GetMakefile()->GetUnConfiguredDirectories();
// for each subdir recurse // for each subdir recurse
std::vector<cmLocalGenerator *>::iterator sdi = subdirs.begin(); std::vector<cmLocalGenerator *>::iterator sdi = subdirs.begin();
for (; sdi != subdirs.end(); ++sdi) for (; sdi != subdirs.end(); ++sdi)
{ {
if (!(*sdi)->GetMakefile()->IsConfigured()) this->Makefile->ConfigureSubDirectory(*sdi);
{
this->Makefile->ConfigureSubDirectory(*sdi);
}
} }
this->Makefile->AddCMakeDependFilesFromUser(); this->Makefile->AddCMakeDependFilesFromUser();
......
...@@ -1599,6 +1599,15 @@ void cmMakefile::ConfigureSubDirectory(cmLocalGenerator *lg2) ...@@ -1599,6 +1599,15 @@ void cmMakefile::ConfigureSubDirectory(cmLocalGenerator *lg2)
} }
// finally configure the subdir // finally configure the subdir
lg2->Configure(); lg2->Configure();
// at the end handle any old style subdirs
for (std::vector<cmLocalGenerator *>::iterator sdi =
this->UnConfiguredDirectories.begin();
sdi != this->UnConfiguredDirectories.end(); ++sdi)
{
this->ConfigureSubDirectory(*sdi);
}
if (this->GetCMakeInstance()->GetDebugOutput()) if (this->GetCMakeInstance()->GetDebugOutput())
{ {
std::string msg=" Returning to "; std::string msg=" Returning to ";
...@@ -1638,6 +1647,10 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath, ...@@ -1638,6 +1647,10 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath,
{ {
this->ConfigureSubDirectory(lg2); this->ConfigureSubDirectory(lg2);
} }
else
{
this->UnConfiguredDirectories.push_back(lg2);
}
} }
void cmMakefile::SetCurrentSourceDirectory(const std::string& dir) void cmMakefile::SetCurrentSourceDirectory(const std::string& dir)
......
...@@ -262,6 +262,11 @@ public: ...@@ -262,6 +262,11 @@ public:
this->LinkDirectories = vec; this->LinkDirectories = vec;
} }
std::vector<cmLocalGenerator*> GetUnConfiguredDirectories() const
{
return this->UnConfiguredDirectories;
}
/** /**
* Add a subdirectory to the build. * Add a subdirectory to the build.
*/ */
...@@ -920,6 +925,8 @@ private: ...@@ -920,6 +925,8 @@ private:
mutable cmsys::RegularExpression cmAtVarRegex; mutable cmsys::RegularExpression cmAtVarRegex;
mutable cmsys::RegularExpression cmNamedCurly; mutable cmsys::RegularExpression cmNamedCurly;
std::vector<cmLocalGenerator*> UnConfiguredDirectories;
cmPropertyMap Properties; cmPropertyMap Properties;
// Unused variable flags // Unused variable flags
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment