summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-05-30 19:39:08 +0200
committerBrad King <brad.king@kitware.com>2015-06-04 09:06:41 -0400
commit69a038a9e90a8839b69f4cb8826688be611e8b0d (patch)
treec645fe0ad15a511f56a58d9cd201ce14dbd9586f
parent0863797037b82f01cb356cb2cd4cdcef7ca8ae48 (diff)
downloadcmake-69a038a9e90a8839b69f4cb8826688be611e8b0d.tar.gz
cmMakefile: Refactor directories specified with the subdirs command.
Store the directories on the cmMakefile as explicitly not-configured-yet.
-rw-r--r--Source/cmLocalGenerator.cxx11
-rw-r--r--Source/cmMakefile.cxx13
-rw-r--r--Source/cmMakefile.h7
3 files changed, 24 insertions, 7 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 8931e6f46e..58366d1a93 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -119,18 +119,15 @@ void cmLocalGenerator::Configure()
assert(cmSystemTools::FileExists(currentStart.c_str(), true));
this->Makefile->ProcessBuildsystemFile(currentStart.c_str());
- // at the end of the ReadListFile handle any old style subdirs
- // first get all the subdirectories
- std::vector<cmLocalGenerator *> subdirs = this->GetChildren();
+ // at the end handle any old style subdirs
+ std::vector<cmLocalGenerator *> subdirs =
+ this->GetMakefile()->GetUnConfiguredDirectories();
// for each subdir recurse
std::vector<cmLocalGenerator *>::iterator sdi = subdirs.begin();
for (; sdi != subdirs.end(); ++sdi)
{
- if (!(*sdi)->GetMakefile()->IsConfigured())
- {
- this->Makefile->ConfigureSubDirectory(*sdi);
- }
+ this->Makefile->ConfigureSubDirectory(*sdi);
}
this->Makefile->AddCMakeDependFilesFromUser();
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index d537f34b6f..ffc6bf975c 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1599,6 +1599,15 @@ void cmMakefile::ConfigureSubDirectory(cmLocalGenerator *lg2)
}
// finally configure the subdir
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())
{
std::string msg=" Returning to ";
@@ -1638,6 +1647,10 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath,
{
this->ConfigureSubDirectory(lg2);
}
+ else
+ {
+ this->UnConfiguredDirectories.push_back(lg2);
+ }
}
void cmMakefile::SetCurrentSourceDirectory(const std::string& dir)
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index a45d8374c9..509f5c8ae9 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -262,6 +262,11 @@ public:
this->LinkDirectories = vec;
}
+ std::vector<cmLocalGenerator*> GetUnConfiguredDirectories() const
+ {
+ return this->UnConfiguredDirectories;
+ }
+
/**
* Add a subdirectory to the build.
*/
@@ -920,6 +925,8 @@ private:
mutable cmsys::RegularExpression cmAtVarRegex;
mutable cmsys::RegularExpression cmNamedCurly;
+ std::vector<cmLocalGenerator*> UnConfiguredDirectories;
+
cmPropertyMap Properties;
// Unused variable flags