From 32f131b0ca68bc88bbb32dbf03e76dfba24defe5 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 2 Aug 2015 19:42:31 +0200 Subject: cmGeneratorTarget: Prefer the local generator to access the global. --- Source/cmGeneratorTarget.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index c831704..b19856d 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -234,7 +234,7 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg) { this->Makefile = this->Target->GetMakefile(); this->LocalGenerator = lg; - this->GlobalGenerator = this->Makefile->GetGlobalGenerator(); + this->GlobalGenerator = this->LocalGenerator->GetGlobalGenerator(); } cmGeneratorTarget::~cmGeneratorTarget() @@ -1556,7 +1556,7 @@ cmTargetTraceDependencies { // Convenience. this->Makefile = this->Target->GetMakefile(); - this->GlobalGenerator = this->Makefile->GetGlobalGenerator(); + this->GlobalGenerator = target->GetLocalGenerator()->GetGlobalGenerator(); this->CurrentEntry = 0; // Queue all the source files already specified for the target. @@ -1944,8 +1944,7 @@ void cmGeneratorTarget::GenerateTargetManifest( { return; } - cmMakefile* mf = this->Target->GetMakefile(); - cmGlobalGenerator* gg = mf->GetGlobalGenerator(); + cmGlobalGenerator* gg = this->LocalGenerator->GetGlobalGenerator(); // Get the names. std::string name; -- cgit v0.12 From 193699376af09bd77875d4ddfd10c3feb13ecdd2 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 2 Aug 2015 19:44:31 +0200 Subject: cmGeneratorTarget: Port internal type to cmGeneratorTarget. --- Source/cmGeneratorTarget.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index b19856d..e914cf6 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -36,7 +36,7 @@ //---------------------------------------------------------------------------- void reportBadObjLib(std::vector const& badObjLib, - cmTarget *target, cmake *cm) + cmGeneratorTarget const* target, cmake *cm) { if(!badObjLib.empty()) { @@ -50,7 +50,7 @@ void reportBadObjLib(std::vector const& badObjLib, e << "but may contain only sources that compile, header files, and " "other files that would not affect linking of a normal library."; cm->IssueMessage(cmake::FATAL_ERROR, e.str(), - target->GetBacktrace()); + target->Target->GetBacktrace()); } } @@ -133,14 +133,14 @@ struct TagVisitor { DataType& Data; std::vector BadObjLibFiles; - cmTarget *Target; + cmGeneratorTarget const* Target; cmGlobalGenerator *GlobalGenerator; cmsys::RegularExpression Header; bool IsObjLib; - TagVisitor(cmTarget *target, DataType& data) + TagVisitor(cmGeneratorTarget const* target, DataType& data) : Data(data), Target(target), - GlobalGenerator(target->GetMakefile()->GetGlobalGenerator()), + GlobalGenerator(target->GetLocalGenerator()->GetGlobalGenerator()), Header(CM_HEADER_REGEX), IsObjLib(target->GetType() == cmTarget::OBJECT_LIBRARY) { @@ -362,7 +362,7 @@ static void handleSystemIncludesDep(cmMakefile *mf, cmTarget const* depTgt, { \ std::vector sourceFiles; \ this->Target->GetSourceFiles(sourceFiles, config); \ - TagVisitor visitor(this->Target, data); \ + TagVisitor visitor(this, data); \ for(std::vector::const_iterator si = sourceFiles.begin(); \ si != sourceFiles.end(); ++si) \ { \ -- cgit v0.12 From 73e4df99cb4d63f5ea8babb40656a74305d77e12 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 2 Aug 2015 20:21:22 +0200 Subject: cmGlobalGenerator: Store a container of cmMakefiles. For use at configure-time. --- Source/cmGlobalGenerator.cxx | 9 +++++++++ Source/cmGlobalGenerator.h | 4 ++++ Source/cmMakefile.cxx | 1 + 3 files changed, 14 insertions(+) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 3c818ff..749ab6e 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1129,6 +1129,7 @@ void cmGlobalGenerator::Configure() // start with this directory cmLocalGenerator *lg = this->MakeLocalGenerator(); + this->Makefiles.push_back(lg->GetMakefile()); this->LocalGenerators.push_back(lg); // set the Start directories @@ -1599,6 +1600,8 @@ void cmGlobalGenerator::ClearGeneratorMembers() cmDeleteAll(this->BuildExportSets); this->BuildExportSets.clear(); + this->Makefiles.clear(); + cmDeleteAll(this->LocalGenerators); this->LocalGenerators.clear(); @@ -1929,6 +1932,12 @@ std::string cmGlobalGenerator::GenerateCMakeBuildCommand( } //---------------------------------------------------------------------------- +void cmGlobalGenerator::AddMakefile(cmMakefile *mf) +{ + this->Makefiles.push_back(mf); +} + +//---------------------------------------------------------------------------- void cmGlobalGenerator::AddLocalGenerator(cmLocalGenerator *lg) { this->LocalGenerators.push_back(lg); diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 3402fbc..616011f 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -173,6 +173,8 @@ public: cmake *GetCMakeInstance() const { return this->CMakeInstance; } void SetConfiguredFilesPath(cmGlobalGenerator* gen); + const std::vector& GetMakefiles() const { + return this->Makefiles;} const std::vector& GetLocalGenerators() const { return this->LocalGenerators;} @@ -184,6 +186,7 @@ public: void SetCurrentMakefile(cmMakefile* mf) {this->CurrentMakefile = mf;} + void AddMakefile(cmMakefile *mf); void AddLocalGenerator(cmLocalGenerator *lg); ///! Set an generator for an "external makefile based project" @@ -402,6 +405,7 @@ protected: std::string FindMakeProgramFile; std::string ConfiguredFilesPath; cmake *CMakeInstance; + std::vector Makefiles; std::vector LocalGenerators; cmMakefile* CurrentMakefile; // map from project name to vector of local generators in that project diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 60a11e1..85bc493 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1857,6 +1857,7 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath, // create a new local generator and set its parent cmLocalGenerator *lg2 = this->GetGlobalGenerator() ->MakeLocalGenerator(newSnapshot, this->LocalGenerator); + this->GetGlobalGenerator()->AddMakefile(lg2->GetMakefile()); this->GetGlobalGenerator()->AddLocalGenerator(lg2); cmMakefile* subMf = lg2->GetMakefile(); -- cgit v0.12 From 3dd6f0a5bc0b6457c82df0b980a8f6ac87d1a6f9 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 2 Aug 2015 13:15:47 +0200 Subject: cmake: Port configure-time code to cmMakefile. --- Source/cmake.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 8c455b2..d1e6265 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1592,7 +1592,7 @@ int cmake::ActualConfigure() } } - cmMakefile* mf=this->GlobalGenerator->GetLocalGenerators()[0]->GetMakefile(); + cmMakefile* mf=this->GlobalGenerator->GetMakefiles()[0]; if (mf->IsOn("CTEST_USE_LAUNCHERS") && !this->State->GetGlobalProperty("RULE_LAUNCH_COMPILE")) { -- cgit v0.12 From 204aecdf82aa583b213464411069de4c8d7af64b Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 2 Aug 2015 20:26:32 +0200 Subject: cmGlobalGenerator: Port configure-time code to cmMakefile. --- Source/cmGlobalGenerator.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 749ab6e..5266b23 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2821,9 +2821,9 @@ cmGlobalGenerator::AddRuleHash(const std::vector& outputs, } // Shorten the output name (in expected use case). - cmLocalGenerator* lg = this->GetLocalGenerators()[0]; - std::string fname = lg->Convert(outputs[0], - cmLocalGenerator::HOME_OUTPUT); + cmOutputConverter converter(this->GetMakefiles()[0]->GetStateSnapshot()); + std::string fname = converter.Convert( + outputs[0], cmLocalGenerator::HOME_OUTPUT); // Associate the hash with this output. this->RuleHashes[fname] = hash; -- cgit v0.12 From bc1097e3d9a2d9545db849f9eef657477d83509a Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 2 Aug 2015 13:18:30 +0200 Subject: cmExportLibraryDependenciesCommand: Port to cmMakefile. --- Source/cmExportLibraryDependenciesCommand.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx index cb150a7..fde8fb1 100644 --- a/Source/cmExportLibraryDependenciesCommand.cxx +++ b/Source/cmExportLibraryDependenciesCommand.cxx @@ -11,7 +11,6 @@ ============================================================================*/ #include "cmExportLibraryDependenciesCommand.h" #include "cmGlobalGenerator.h" -#include "cmLocalGenerator.h" #include "cmGeneratedFileStream.h" #include "cmake.h" #include "cmVersion.h" @@ -82,15 +81,14 @@ void cmExportLibraryDependenciesCommand::ConstFinalPass() const // the project. cmake* cm = this->Makefile->GetCMakeInstance(); cmGlobalGenerator* global = cm->GetGlobalGenerator(); - const std::vector& locals = global->GetLocalGenerators(); + const std::vector& locals = global->GetMakefiles(); std::map libDepsOld; std::map libDepsNew; std::map libTypes; - for(std::vector::const_iterator i = locals.begin(); + for(std::vector::const_iterator i = locals.begin(); i != locals.end(); ++i) { - const cmLocalGenerator* gen = *i; - const cmTargets &tgts = gen->GetMakefile()->GetTargets(); + const cmTargets &tgts = (*i)->GetTargets(); for(cmTargets::const_iterator l = tgts.begin(); l != tgts.end(); ++l) { -- cgit v0.12 From f8be9ba9c258698ed88a7510cf2ba3335491f3da Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 2 Aug 2015 12:13:41 +0200 Subject: cmGlobalGenerator: Base progress on Makefiles, not LocalGenerators. --- Source/cmGlobalGenerator.cxx | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 5266b23..5787a9d 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1148,9 +1148,9 @@ void cmGlobalGenerator::Configure() // update the cache entry for the number of local generators, this is used // for progress char num[100]; - sprintf(num,"%d",static_cast(this->LocalGenerators.size())); + sprintf(num,"%d",static_cast(this->Makefiles.size())); this->GetCMakeInstance()->AddCacheEntry - ("CMAKE_NUMBER_OF_LOCAL_GENERATORS", num, + ("CMAKE_NUMBER_OF_MAKEFILES", num, "number of local generators", cmState::INTERNAL); // check for link libraries and include directories containing "NOTFOUND" @@ -1742,9 +1742,9 @@ int cmGlobalGenerator::TryCompile(const std::string& srcdir, // take the bulk of the time, so try and guess some progress // by getting closer and closer to 100 without actually getting there. if (!this->CMakeInstance->GetState()->GetInitializedCacheValue - ("CMAKE_NUMBER_OF_LOCAL_GENERATORS")) + ("CMAKE_NUMBER_OF_MAKEFILES")) { - // If CMAKE_NUMBER_OF_LOCAL_GENERATORS is not set + // If CMAKE_NUMBER_OF_MAKEFILES is not set // we are in the first time progress and we have no // idea how long it will be. So, just move 1/10th of the way // there each time, and don't go over 95% @@ -1935,22 +1935,16 @@ std::string cmGlobalGenerator::GenerateCMakeBuildCommand( void cmGlobalGenerator::AddMakefile(cmMakefile *mf) { this->Makefiles.push_back(mf); -} - -//---------------------------------------------------------------------------- -void cmGlobalGenerator::AddLocalGenerator(cmLocalGenerator *lg) -{ - this->LocalGenerators.push_back(lg); // update progress // estimate how many lg there will be const char *numGenC = this->CMakeInstance->GetState()->GetInitializedCacheValue - ("CMAKE_NUMBER_OF_LOCAL_GENERATORS"); + ("CMAKE_NUMBER_OF_MAKEFILES"); if (!numGenC) { - // If CMAKE_NUMBER_OF_LOCAL_GENERATORS is not set + // If CMAKE_NUMBER_OF_MAKEFILES is not set // we are in the first time progress and we have no // idea how long it will be. So, just move half way // there each time, and don't go over 95% @@ -1965,7 +1959,7 @@ void cmGlobalGenerator::AddLocalGenerator(cmLocalGenerator *lg) } int numGen = atoi(numGenC); - float prog = 0.9f*static_cast(this->LocalGenerators.size())/ + float prog = 0.9f*static_cast(this->Makefiles.size())/ static_cast(numGen); if (prog > 0.9f) { @@ -1974,6 +1968,12 @@ void cmGlobalGenerator::AddLocalGenerator(cmLocalGenerator *lg) this->CMakeInstance->UpdateProgress("Configuring", prog); } +//---------------------------------------------------------------------------- +void cmGlobalGenerator::AddLocalGenerator(cmLocalGenerator *lg) +{ + this->LocalGenerators.push_back(lg); +} + void cmGlobalGenerator::AddInstallComponent(const char* component) { if(component && *component) -- cgit v0.12 From 19b546ef766acedfcc9e19541c71b6a56d7fe630 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 2 Aug 2015 12:17:31 +0200 Subject: cmGlobalGenerator: Base final target property computation on Makefiles. --- Source/cmGlobalGenerator.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 5787a9d..83bfe57 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1482,9 +1482,9 @@ void cmGlobalGenerator::CreateQtAutoGeneratorsTargets(AutogensType &autogens) void cmGlobalGenerator::FinalizeTargetCompileInfo() { // Construct per-target generator information. - for(unsigned int i=0; i < this->LocalGenerators.size(); ++i) + for(unsigned int i=0; i < this->Makefiles.size(); ++i) { - cmMakefile *mf = this->LocalGenerators[i]->GetMakefile(); + cmMakefile *mf = this->Makefiles[i]; const cmStringRange noconfig_compile_definitions = mf->GetCompileDefinitionsEntries(); -- cgit v0.12 From 56f0540b5183036b46babbfc9b9ec0979e54992f Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 2 Aug 2015 12:45:17 +0200 Subject: cmGlobalGenerator: Port Configure-time check to cmMakefile. This uses no generate-time state. --- Source/cmGlobalGenerator.cxx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 83bfe57..98961d8 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1641,11 +1641,11 @@ void cmGlobalGenerator::CheckLocalGenerators() // std::set notFoundMap; // after it is all done do a ConfigureFinalPass cmState* state = this->GetCMakeInstance()->GetState(); - for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) + for (unsigned int i = 0; i < this->Makefiles.size(); ++i) { - this->LocalGenerators[i]->GetMakefile()->ConfigureFinalPass(); + this->Makefiles[i]->ConfigureFinalPass(); cmTargets &targets = - this->LocalGenerators[i]->GetMakefile()->GetTargets(); + this->Makefiles[i]->GetTargets(); for (cmTargets::iterator l = targets.begin(); l != targets.end(); l++) { @@ -1700,15 +1700,14 @@ void cmGlobalGenerator::CheckLocalGenerators() } std::string text = notFoundMap[varName]; text += "\n used as include directory in directory "; - text += this->LocalGenerators[i] - ->GetMakefile()->GetCurrentSourceDirectory(); + text += this->Makefiles[i]->GetCurrentSourceDirectory(); notFoundMap[varName] = text; } } } this->CMakeInstance->UpdateProgress ("Configuring", 0.9f+0.1f*(static_cast(i)+1.0f)/ - static_cast(this->LocalGenerators.size())); + static_cast(this->Makefiles.size())); } if(!notFoundMap.empty()) -- cgit v0.12 From 8f75ea3b5e0b43118a6ecba4dc11a583d287705c Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 2 Aug 2015 12:48:08 +0200 Subject: cmGlobalGenerator: Port global target creation to cmMakefile. --- Source/cmGlobalGenerator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 98961d8..f96cf21 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2247,7 +2247,7 @@ inline std::string removeQuotes(const std::string& s) void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) { - cmMakefile* mf = this->LocalGenerators[0]->GetMakefile(); + cmMakefile* mf = this->Makefiles[0]; const char* cmakeCfgIntDir = this->GetCMakeCFGIntDir(); // CPack -- cgit v0.12 From c5b8841fd96727a290e148e8b5132f893f8b4d4e Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 2 Aug 2015 12:57:06 +0200 Subject: cmGlobalGenerator: Create global targets from cmMakefiles. --- Source/cmGlobalGenerator.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index f96cf21..8645317 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1193,9 +1193,9 @@ void cmGlobalGenerator::Configure() cmTargets globalTargets; this->CreateDefaultGlobalTargets(&globalTargets); - for (i = 0; i < this->LocalGenerators.size(); ++i) + for (i = 0; i < this->Makefiles.size(); ++i) { - cmMakefile* mf = this->LocalGenerators[i]->GetMakefile(); + cmMakefile* mf = this->Makefiles[i]; cmTargets* targets = &(mf->GetTargets()); cmTargets::iterator tit; for ( tit = globalTargets.begin(); tit != globalTargets.end(); ++ tit ) -- cgit v0.12 From 5f66900e71fdc33b40c46bf8a87b35d88d280769 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 2 Aug 2015 12:39:51 +0200 Subject: cmGlobalGenerator: Port Find API to cmMakefile. --- Source/cmGetDirectoryPropertyCommand.cxx | 7 ++----- Source/cmGetPropertyCommand.cxx | 9 ++------- Source/cmGlobalGenerator.cxx | 14 ++++++++++++++ Source/cmGlobalGenerator.h | 1 + Source/cmSetPropertyCommand.cxx | 10 ++-------- 5 files changed, 21 insertions(+), 20 deletions(-) diff --git a/Source/cmGetDirectoryPropertyCommand.cxx b/Source/cmGetDirectoryPropertyCommand.cxx index c056d95..2558876 100644 --- a/Source/cmGetDirectoryPropertyCommand.cxx +++ b/Source/cmGetDirectoryPropertyCommand.cxx @@ -51,10 +51,8 @@ bool cmGetDirectoryPropertyCommand sd = cmSystemTools::CollapseFullPath(sd); // lookup the makefile from the directory name - cmLocalGenerator *lg = - this->Makefile->GetGlobalGenerator()-> - FindLocalGenerator(sd); - if (!lg) + dir = this->Makefile->GetGlobalGenerator()->FindMakefile(sd); + if (!dir) { this->SetError ("DIRECTORY argument provided but requested directory not found. " @@ -62,7 +60,6 @@ bool cmGetDirectoryPropertyCommand "it is valid but has not been processed yet."); return false; } - dir = lg->GetMakefile(); ++i; } diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index 33d638b..4c42f53 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -262,13 +262,8 @@ bool cmGetPropertyCommand::HandleDirectoryMode() dir = cmSystemTools::CollapseFullPath(dir); // Lookup the generator. - if(cmLocalGenerator* lg = - (this->Makefile->GetGlobalGenerator()->FindLocalGenerator(dir))) - { - // Use the makefile for the directory found. - mf = lg->GetMakefile(); - } - else + mf = this->Makefile->GetGlobalGenerator()->FindMakefile(dir); + if (!mf) { // Could not find the directory. this->SetError diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 8645317..1e2d091 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2160,6 +2160,20 @@ void cmGlobalGenerator::FillLocalGeneratorToTargetMap() } } +cmMakefile* +cmGlobalGenerator::FindMakefile(const std::string& start_dir) const +{ + for(std::vector::const_iterator it = + this->Makefiles.begin(); it != this->Makefiles.end(); ++it) + { + std::string sd = (*it)->GetCurrentSourceDirectory(); + if (sd == start_dir) + { + return *it; + } + } + return 0; +} ///! Find a local generator by its startdirectory cmLocalGenerator* diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 616011f..778d946 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -256,6 +256,7 @@ public: that is a framework. */ bool NameResolvesToFramework(const std::string& libname) const; + cmMakefile* FindMakefile(const std::string& start_dir) const; ///! Find a local generator by its startdirectory cmLocalGenerator* FindLocalGenerator(const std::string& start_dir) const; diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index 31e460f..17ad475 100644 --- a/Source/cmSetPropertyCommand.cxx +++ b/Source/cmSetPropertyCommand.cxx @@ -205,14 +205,8 @@ bool cmSetPropertyCommand::HandleDirectoryMode() // The local generators are associated with collapsed paths. dir = cmSystemTools::CollapseFullPath(dir); - // Lookup the generator. - if(cmLocalGenerator* lg = - this->Makefile->GetGlobalGenerator()->FindLocalGenerator(dir)) - { - // Use the makefile for the directory found. - mf = lg->GetMakefile(); - } - else + mf = this->Makefile->GetGlobalGenerator()->FindMakefile(dir); + if (!mf) { // Could not find the directory. this->SetError -- cgit v0.12 From 6d8a125e4988d5cb269b3d1e29a6114ecd0c47a4 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 2 Aug 2015 20:39:24 +0200 Subject: cmQtAutoGenerators: Prefer a generator to access global generator. --- Source/cmQtAutoGenerators.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index f1ba2f4..c619cdc 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -369,7 +369,7 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmLocalGenerator* lg, #if defined(_WIN32) && !defined(__CYGWIN__) bool usePRE_BUILD = false; - cmGlobalGenerator* gg = makefile->GetGlobalGenerator(); + cmGlobalGenerator* gg = lg->GetGlobalGenerator(); if(gg->GetName().find("Visual Studio") != std::string::npos) { cmGlobalVisualStudioGenerator* vsgg = @@ -396,7 +396,7 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmLocalGenerator* lg, std::vector rcc_output; bool const isNinja = - makefile->GetGlobalGenerator()->GetName() == "Ninja"; + lg->GetGlobalGenerator()->GetName() == "Ninja"; if(isNinja #if defined(_WIN32) && !defined(__CYGWIN__) || usePRE_BUILD -- cgit v0.12