diff options
author | Brad King <brad.king@kitware.com> | 2015-08-31 13:48:28 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-08-31 13:48:28 (GMT) |
commit | 352e8e95b65e19cca10b4aec0c626787dfbb1ba1 (patch) | |
tree | 936261c46c550e734a5b8faab5623c1121b2b9e0 /Source/cmGlobalGenerator.cxx | |
parent | 97db5c567894c253173ab45c919925ce010ab05e (diff) | |
parent | 2b9a25d7f723a9876e2979de8e6c06881e0312dc (diff) | |
download | CMake-352e8e95b65e19cca10b4aec0c626787dfbb1ba1.zip CMake-352e8e95b65e19cca10b4aec0c626787dfbb1ba1.tar.gz CMake-352e8e95b65e19cca10b4aec0c626787dfbb1ba1.tar.bz2 |
Merge topic 'generate-time-generators'
2b9a25d7 cmGlobalGenerator: Create global targets directly after Configure.
3e08b4df cmMakefile: Skip Global targets for CMP0019 evaluation.
357bf469 cmGlobalGenerator: Fill the project map at compute time.
ebf8d0a9 cmGlobalGenerator: Rename method.
bd096d30 cmGlobalGenerator: Avoid cmLocalGenerator until after Configure.
ff8ac8ee cmLocalGenerator: Create from already-constructed cmMakefile.
0bd7279f Ninja: Remove some incorrect comments adding no value.
2f2d4da9 cmCTestScriptHandler: Simplify deletes.
7fdc9a8b QtAutogen: Use a smart pointer.
92041eec cmGlobalGenerator: Remove MakeLocalGenerator method.
acb00622 cmGlobalGenerator: Require a snapshot to create a local generator.
83b8a927 cmMakefile: Remove cmLocalGenerator member.
9b6a743b cmLocalGenerator: Remove Parent pointer.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 80 |
1 files changed, 33 insertions, 47 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 46c1ccc..b3f3cba 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1127,23 +1127,40 @@ void cmGlobalGenerator::Configure() this->FirstTimeProgress = 0.0f; this->ClearGeneratorMembers(); - // start with this directory - cmLocalGenerator *lg = this->MakeLocalGenerator(); - this->Makefiles.push_back(lg->GetMakefile()); + cmMakefile* dirMf = + new cmMakefile(this, this->GetCMakeInstance()->GetCurrentSnapshot()); + this->Makefiles.push_back(dirMf); + cmLocalGenerator *lg = this->CreateLocalGenerator(dirMf); this->LocalGenerators.push_back(lg); // set the Start directories - lg->GetMakefile()->SetCurrentSourceDirectory + dirMf->SetCurrentSourceDirectory (this->CMakeInstance->GetHomeDirectory()); - lg->GetMakefile()->SetCurrentBinaryDirectory + dirMf->SetCurrentBinaryDirectory (this->CMakeInstance->GetHomeOutputDirectory()); this->BinaryDirectories.insert( this->CMakeInstance->GetHomeOutputDirectory()); // now do it - lg->GetMakefile()->Configure(); - lg->GetMakefile()->EnforceDirectoryLevelRules(); + dirMf->Configure(); + dirMf->EnforceDirectoryLevelRules(); + + // Put a copy of each global target in every directory. + cmTargets globalTargets; + this->CreateDefaultGlobalTargets(&globalTargets); + + for (unsigned int i = 0; i < this->Makefiles.size(); ++i) + { + cmMakefile* mf = this->Makefiles[i]; + cmTargets* targets = &(mf->GetTargets()); + cmTargets::iterator tit; + for ( tit = globalTargets.begin(); tit != globalTargets.end(); ++ tit ) + { + (*targets)[tit->first] = tit->second; + (*targets)[tit->first].SetMakefile(mf); + } + } // update the cache entry for the number of local generators, this is used // for progress @@ -1155,11 +1172,7 @@ void cmGlobalGenerator::Configure() // check for link libraries and include directories containing "NOTFOUND" // and for infinite loops - this->CheckLocalGenerators(); - - // at this point this->LocalGenerators has been filled, - // so create the map from project name to vector of local generators - this->FillProjectMap(); + this->CheckTargetProperties(); if ( this->CMakeInstance->GetWorkingMode() == cmake::NORMAL_MODE) { @@ -1186,25 +1199,6 @@ void cmGlobalGenerator::Configure() } this->CMakeInstance->UpdateProgress(msg.str().c_str(), -1); } - - unsigned int i; - - // Put a copy of each global target in every directory. - cmTargets globalTargets; - this->CreateDefaultGlobalTargets(&globalTargets); - - for (i = 0; i < this->Makefiles.size(); ++i) - { - cmMakefile* mf = this->Makefiles[i]; - cmTargets* targets = &(mf->GetTargets()); - cmTargets::iterator tit; - for ( tit = globalTargets.begin(); tit != globalTargets.end(); ++ tit ) - { - (*targets)[tit->first] = tit->second; - (*targets)[tit->first].SetMakefile(mf); - } - } - } void cmGlobalGenerator::CreateGenerationObjects(TargetTypes targetTypes) @@ -1267,6 +1261,10 @@ bool cmGlobalGenerator::Compute() this->CreateGenerationObjects(); + // at this point this->LocalGenerators has been filled, + // so create the map from project name to vector of local generators + this->FillProjectMap(); + #ifdef CMAKE_BUILD_WITH_CMAKE // Iterate through all targets and set up automoc for those which have // the AUTOMOC, AUTOUIC or AUTORCC property set @@ -1600,6 +1598,7 @@ void cmGlobalGenerator::ClearGeneratorMembers() cmDeleteAll(this->BuildExportSets); this->BuildExportSets.clear(); + cmDeleteAll(this->Makefiles); this->Makefiles.clear(); cmDeleteAll(this->LocalGenerators); @@ -1634,7 +1633,7 @@ void cmGlobalGenerator::ComputeTargetObjectDirectory(cmGeneratorTarget*) const { } -void cmGlobalGenerator::CheckLocalGenerators() +void cmGlobalGenerator::CheckTargetProperties() { std::map<std::string, std::string> notFoundMap; // std::set<std::string> notFoundMap; @@ -1985,23 +1984,10 @@ void cmGlobalGenerator::EnableInstallTarget() this->InstallTargetEnabled = true; } -cmLocalGenerator * -cmGlobalGenerator::MakeLocalGenerator(cmState::Snapshot snapshot, - cmLocalGenerator *parent) -{ - if (!snapshot.IsValid()) - { - snapshot = this->CMakeInstance->GetCurrentSnapshot(); - } - - return this->CreateLocalGenerator(parent, snapshot); -} - cmLocalGenerator* -cmGlobalGenerator::CreateLocalGenerator(cmLocalGenerator* parent, - cmState::Snapshot snapshot) +cmGlobalGenerator::CreateLocalGenerator(cmMakefile* mf) { - return new cmLocalGenerator(this, parent, snapshot); + return new cmLocalGenerator(this, mf); } void cmGlobalGenerator::EnableLanguagesFromGenerator(cmGlobalGenerator *gen, |