diff options
author | Ken Martin <ken.martin@kitware.com> | 2005-03-18 15:41:41 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2005-03-18 15:41:41 (GMT) |
commit | 345cf0401235a1fd64bb9b1c353e0e3fc848d666 (patch) | |
tree | 6c1862e3516cd436f3068221ae9fcc11144724b8 /Source/cmLocalGenerator.cxx | |
parent | 1f9df24ba7e76cbd7ecc1816a9f8d46b61816e95 (diff) | |
download | CMake-345cf0401235a1fd64bb9b1c353e0e3fc848d666.zip CMake-345cf0401235a1fd64bb9b1c353e0e3fc848d666.tar.gz CMake-345cf0401235a1fd64bb9b1c353e0e3fc848d666.tar.bz2 |
ENH: big change that includes immediate subdir support, removing the notion of inherited commands, makefiles no longer read in the parent makefiles but instead inherit thier parent makefiles current settings
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 504b624..f504647 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -20,7 +20,6 @@ #include "cmMakefile.h" #include "cmGeneratedFileStream.h" #include "cmSourceFile.h" -#include "cmSubDirectory.h" #include "cmOrderLinkDirectories.h" cmLocalGenerator::cmLocalGenerator() @@ -32,6 +31,7 @@ cmLocalGenerator::cmLocalGenerator() m_WindowsShell = false; m_IgnoreLibPrefix = false; m_UseRelativePaths = false; + this->Configured = false; } cmLocalGenerator::~cmLocalGenerator() @@ -53,6 +53,20 @@ void cmLocalGenerator::Configure() currentStart += "/CMakeLists.txt"; m_Makefile->ReadListFile(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(); + + // for each subdir recurse + std::vector<cmLocalGenerator *>::iterator sdi = subdirs.begin(); + for (; sdi != subdirs.end(); ++sdi) + { + if (!(*sdi)->Configured) + { + m_Makefile->ConfigureSubDirectory(*sdi); + } + } + // Setup the current output directory components for use by // ConvertToRelativePath. std::string outdir = @@ -62,6 +76,8 @@ void cmLocalGenerator::Configure() // Check whether relative paths should be used for optionally // relative paths. m_UseRelativePaths = m_Makefile->IsOn("CMAKE_USE_RELATIVE_PATHS"); + + this->Configured = true; } void cmLocalGenerator::SetGlobalGenerator(cmGlobalGenerator *gg) @@ -316,14 +332,13 @@ void cmLocalGenerator::GenerateInstallRules() fout << "INCLUDE(\"" << postinstall << "\")" << std::endl; } } - cmMakefile* mf = this->GetMakefile(); - if ( !mf->GetSubDirectories().empty() ) + + if ( this->Children.size()) { - const std::vector<cmSubDirectory>& subdirs = mf->GetSubDirectories(); - std::vector<cmSubDirectory>::const_iterator i = subdirs.begin(); - for(; i != subdirs.end(); ++i) + std::vector<cmLocalGenerator*>::const_iterator i = this->Children.begin(); + for(; i != this->Children.end(); ++i) { - std::string odir = i->BinaryPath; + std::string odir = (*i)->GetMakefile()->GetStartOutputDirectory(); cmSystemTools::ConvertToUnixSlashes(odir); fout << "INCLUDE(\"" << odir.c_str() << "/cmake_install.cmake\")" << std::endl; |