From a48aebcb67a66bd2fee1318bb971cc5e3b016410 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 28 Apr 2015 07:50:52 +0200 Subject: [PATCH] cmLocalGenerator: Require a parent in the constructor. Pass the parent though cmGlobalGenerator::CreateLocalGenerator. This will make it easy to initialize state scopes independent of cmMakefile. --- Source/cmGlobalBorlandMakefileGenerator.cxx | 6 ++++-- Source/cmGlobalBorlandMakefileGenerator.h | 2 +- Source/cmGlobalGenerator.cxx | 5 +++-- Source/cmGlobalGenerator.h | 2 +- Source/cmGlobalGhsMultiGenerator.cxx | 5 +++-- Source/cmGlobalGhsMultiGenerator.h | 2 +- Source/cmGlobalJOMMakefileGenerator.cxx | 6 ++++-- Source/cmGlobalJOMMakefileGenerator.h | 2 +- Source/cmGlobalMSYSMakefileGenerator.cxx | 6 ++++-- Source/cmGlobalMSYSMakefileGenerator.h | 2 +- Source/cmGlobalMinGWMakefileGenerator.cxx | 6 ++++-- Source/cmGlobalMinGWMakefileGenerator.h | 2 +- Source/cmGlobalNMakeMakefileGenerator.cxx | 6 ++++-- Source/cmGlobalNMakeMakefileGenerator.h | 2 +- Source/cmGlobalNinjaGenerator.cxx | 5 +++-- Source/cmGlobalNinjaGenerator.h | 2 +- Source/cmGlobalUnixMakefileGenerator3.cxx | 5 +++-- Source/cmGlobalUnixMakefileGenerator3.h | 2 +- Source/cmGlobalVisualStudio10Generator.cxx | 6 ++++-- Source/cmGlobalVisualStudio10Generator.h | 2 +- Source/cmGlobalVisualStudio11Generator.cxx | 6 ++++-- Source/cmGlobalVisualStudio11Generator.h | 2 +- Source/cmGlobalVisualStudio12Generator.cxx | 6 ++++-- Source/cmGlobalVisualStudio12Generator.h | 2 +- Source/cmGlobalVisualStudio14Generator.cxx | 6 ++++-- Source/cmGlobalVisualStudio14Generator.h | 2 +- Source/cmGlobalVisualStudio6Generator.cxx | 5 +++-- Source/cmGlobalVisualStudio6Generator.h | 2 +- Source/cmGlobalVisualStudio71Generator.cxx | 6 ++++-- Source/cmGlobalVisualStudio71Generator.h | 2 +- Source/cmGlobalVisualStudio7Generator.cxx | 6 ++++-- Source/cmGlobalVisualStudio7Generator.h | 2 +- Source/cmGlobalVisualStudio8Generator.cxx | 6 ++++-- Source/cmGlobalVisualStudio8Generator.h | 2 +- Source/cmGlobalVisualStudio9Generator.cxx | 6 ++++-- Source/cmGlobalVisualStudio9Generator.h | 2 +- Source/cmGlobalWatcomWMakeGenerator.cxx | 6 ++++-- Source/cmGlobalWatcomWMakeGenerator.h | 2 +- Source/cmGlobalXCodeGenerator.cxx | 5 +++-- Source/cmGlobalXCodeGenerator.h | 2 +- Source/cmLocalGenerator.cxx | 8 ++++++-- Source/cmLocalGenerator.h | 3 +-- Source/cmLocalGhsMultiGenerator.cxx | 3 ++- Source/cmLocalGhsMultiGenerator.h | 2 +- Source/cmLocalNinjaGenerator.cxx | 4 ++-- Source/cmLocalNinjaGenerator.h | 2 +- Source/cmLocalUnixMakefileGenerator3.cxx | 4 +++- Source/cmLocalUnixMakefileGenerator3.h | 2 +- Source/cmLocalVisualStudio10Generator.cxx | 5 +++-- Source/cmLocalVisualStudio10Generator.h | 2 +- Source/cmLocalVisualStudio6Generator.cxx | 5 +++-- Source/cmLocalVisualStudio6Generator.h | 2 +- Source/cmLocalVisualStudio7Generator.cxx | 5 +++-- Source/cmLocalVisualStudio7Generator.h | 2 +- Source/cmLocalVisualStudioGenerator.cxx | 4 +++- Source/cmLocalVisualStudioGenerator.h | 2 +- Source/cmLocalXCodeGenerator.cxx | 3 ++- Source/cmLocalXCodeGenerator.h | 2 +- Source/cmMakefile.cxx | 4 ++-- 59 files changed, 132 insertions(+), 86 deletions(-) diff --git a/Source/cmGlobalBorlandMakefileGenerator.cxx b/Source/cmGlobalBorlandMakefileGenerator.cxx index e55761992..597e08ef5 100644 --- a/Source/cmGlobalBorlandMakefileGenerator.cxx +++ b/Source/cmGlobalBorlandMakefileGenerator.cxx @@ -37,9 +37,11 @@ void cmGlobalBorlandMakefileGenerator } ///! Create a local generator appropriate to this Global Generator -cmLocalGenerator *cmGlobalBorlandMakefileGenerator::CreateLocalGenerator() +cmLocalGenerator *cmGlobalBorlandMakefileGenerator::CreateLocalGenerator( + cmLocalGenerator* parent) { - cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3; + cmLocalUnixMakefileGenerator3* lg = + new cmLocalUnixMakefileGenerator3(parent); lg->SetIncludeDirective("!include"); lg->SetWindowsShell(true); lg->SetDefineWindowsNULL(true); diff --git a/Source/cmGlobalBorlandMakefileGenerator.h b/Source/cmGlobalBorlandMakefileGenerator.h index 005f0d694..3f79414d0 100644 --- a/Source/cmGlobalBorlandMakefileGenerator.h +++ b/Source/cmGlobalBorlandMakefileGenerator.h @@ -36,7 +36,7 @@ public: static void GetDocumentation(cmDocumentationEntry& entry); ///! Create a local generator appropriate to this Global Generator - virtual cmLocalGenerator *CreateLocalGenerator(); + virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0); /** * Try to determine system information such as shared library diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 774b172b0..384f023d7 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1878,9 +1878,10 @@ void cmGlobalGenerator::EnableInstallTarget() this->InstallTargetEnabled = true; } -cmLocalGenerator *cmGlobalGenerator::CreateLocalGenerator() +cmLocalGenerator * +cmGlobalGenerator::CreateLocalGenerator(cmLocalGenerator *parent) { - cmLocalGenerator *lg = new cmLocalGenerator; + cmLocalGenerator *lg = new cmLocalGenerator(parent); lg->SetGlobalGenerator(this); return lg; } diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index ce3f03773..b51bd475c 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -53,7 +53,7 @@ public: virtual ~cmGlobalGenerator(); ///! Create a local generator appropriate to this Global Generator - virtual cmLocalGenerator *CreateLocalGenerator(); + virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0); ///! Get the name for this generator virtual std::string GetName() const { return "Generic"; } diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx index bba29b1db..181a5174c 100644 --- a/Source/cmGlobalGhsMultiGenerator.cxx +++ b/Source/cmGlobalGhsMultiGenerator.cxx @@ -32,9 +32,10 @@ cmGlobalGhsMultiGenerator::~cmGlobalGhsMultiGenerator() cmDeleteAll(TargetFolderBuildStreams); } -cmLocalGenerator *cmGlobalGhsMultiGenerator::CreateLocalGenerator() +cmLocalGenerator * +cmGlobalGhsMultiGenerator::CreateLocalGenerator(cmLocalGenerator* parent) { - cmLocalGenerator *lg = new cmLocalGhsMultiGenerator; + cmLocalGenerator *lg = new cmLocalGhsMultiGenerator(parent); lg->SetGlobalGenerator(this); this->SetCurrentLocalGenerator(lg); return lg; diff --git a/Source/cmGlobalGhsMultiGenerator.h b/Source/cmGlobalGhsMultiGenerator.h index b934c3a10..6464f5cc9 100644 --- a/Source/cmGlobalGhsMultiGenerator.h +++ b/Source/cmGlobalGhsMultiGenerator.h @@ -31,7 +31,7 @@ public: { return new cmGlobalGeneratorSimpleFactory(); } ///! create the correct local generator - virtual cmLocalGenerator *CreateLocalGenerator(); + virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0); /// @return the name of this generator. static std::string GetActualName() { return "Green Hills MULTI"; } diff --git a/Source/cmGlobalJOMMakefileGenerator.cxx b/Source/cmGlobalJOMMakefileGenerator.cxx index bc15ef297..cfa5072a4 100644 --- a/Source/cmGlobalJOMMakefileGenerator.cxx +++ b/Source/cmGlobalJOMMakefileGenerator.cxx @@ -45,9 +45,11 @@ void cmGlobalJOMMakefileGenerator } ///! Create a local generator appropriate to this Global Generator -cmLocalGenerator *cmGlobalJOMMakefileGenerator::CreateLocalGenerator() +cmLocalGenerator * +cmGlobalJOMMakefileGenerator::CreateLocalGenerator(cmLocalGenerator* parent) { - cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3; + cmLocalUnixMakefileGenerator3* lg + = new cmLocalUnixMakefileGenerator3(parent); lg->SetDefineWindowsNULL(true); lg->SetWindowsShell(true); lg->SetMakeSilentFlag("/nologo"); diff --git a/Source/cmGlobalJOMMakefileGenerator.h b/Source/cmGlobalJOMMakefileGenerator.h index fbb35f34f..483130911 100644 --- a/Source/cmGlobalJOMMakefileGenerator.h +++ b/Source/cmGlobalJOMMakefileGenerator.h @@ -37,7 +37,7 @@ public: static void GetDocumentation(cmDocumentationEntry& entry); ///! Create a local generator appropriate to this Global Generator - virtual cmLocalGenerator *CreateLocalGenerator(); + virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0); /** * Try to determine system information such as shared library diff --git a/Source/cmGlobalMSYSMakefileGenerator.cxx b/Source/cmGlobalMSYSMakefileGenerator.cxx index 16f05e5ed..fa2349135 100644 --- a/Source/cmGlobalMSYSMakefileGenerator.cxx +++ b/Source/cmGlobalMSYSMakefileGenerator.cxx @@ -93,9 +93,11 @@ void cmGlobalMSYSMakefileGenerator } ///! Create a local generator appropriate to this Global Generator -cmLocalGenerator *cmGlobalMSYSMakefileGenerator::CreateLocalGenerator() +cmLocalGenerator * +cmGlobalMSYSMakefileGenerator::CreateLocalGenerator(cmLocalGenerator* parent) { - cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3; + cmLocalUnixMakefileGenerator3* lg = + new cmLocalUnixMakefileGenerator3(parent); lg->SetWindowsShell(false); lg->SetMSYSShell(true); lg->SetGlobalGenerator(this); diff --git a/Source/cmGlobalMSYSMakefileGenerator.h b/Source/cmGlobalMSYSMakefileGenerator.h index baecde742..1795d869e 100644 --- a/Source/cmGlobalMSYSMakefileGenerator.h +++ b/Source/cmGlobalMSYSMakefileGenerator.h @@ -36,7 +36,7 @@ public: static void GetDocumentation(cmDocumentationEntry& entry); ///! Create a local generator appropriate to this Global Generator - virtual cmLocalGenerator *CreateLocalGenerator(); + virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0); /** * Try to determine system information such as shared library diff --git a/Source/cmGlobalMinGWMakefileGenerator.cxx b/Source/cmGlobalMinGWMakefileGenerator.cxx index e00c7ddc8..c9389aac4 100644 --- a/Source/cmGlobalMinGWMakefileGenerator.cxx +++ b/Source/cmGlobalMinGWMakefileGenerator.cxx @@ -31,9 +31,11 @@ void cmGlobalMinGWMakefileGenerator } ///! Create a local generator appropriate to this Global Generator -cmLocalGenerator *cmGlobalMinGWMakefileGenerator::CreateLocalGenerator() +cmLocalGenerator * +cmGlobalMinGWMakefileGenerator::CreateLocalGenerator(cmLocalGenerator* parent) { - cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3; + cmLocalUnixMakefileGenerator3* lg = + new cmLocalUnixMakefileGenerator3(parent); lg->SetWindowsShell(true); lg->SetGlobalGenerator(this); lg->SetIgnoreLibPrefix(true); diff --git a/Source/cmGlobalMinGWMakefileGenerator.h b/Source/cmGlobalMinGWMakefileGenerator.h index fa8d9f24e..93f67bea3 100644 --- a/Source/cmGlobalMinGWMakefileGenerator.h +++ b/Source/cmGlobalMinGWMakefileGenerator.h @@ -35,7 +35,7 @@ public: static void GetDocumentation(cmDocumentationEntry& entry); ///! Create a local generator appropriate to this Global Generator - virtual cmLocalGenerator *CreateLocalGenerator(); + virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0); /** * Try to determine system information such as shared library diff --git a/Source/cmGlobalNMakeMakefileGenerator.cxx b/Source/cmGlobalNMakeMakefileGenerator.cxx index 4fbabe405..a3b3dd7bf 100644 --- a/Source/cmGlobalNMakeMakefileGenerator.cxx +++ b/Source/cmGlobalNMakeMakefileGenerator.cxx @@ -45,9 +45,11 @@ void cmGlobalNMakeMakefileGenerator } ///! Create a local generator appropriate to this Global Generator -cmLocalGenerator *cmGlobalNMakeMakefileGenerator::CreateLocalGenerator() +cmLocalGenerator * +cmGlobalNMakeMakefileGenerator::CreateLocalGenerator(cmLocalGenerator* parent) { - cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3; + cmLocalUnixMakefileGenerator3* lg = + new cmLocalUnixMakefileGenerator3(parent); lg->SetDefineWindowsNULL(true); lg->SetWindowsShell(true); lg->SetMakeSilentFlag("/nologo"); diff --git a/Source/cmGlobalNMakeMakefileGenerator.h b/Source/cmGlobalNMakeMakefileGenerator.h index e7b03ddb9..cb898ba6c 100644 --- a/Source/cmGlobalNMakeMakefileGenerator.h +++ b/Source/cmGlobalNMakeMakefileGenerator.h @@ -35,7 +35,7 @@ public: static void GetDocumentation(cmDocumentationEntry& entry); ///! Create a local generator appropriate to this Global Generator - virtual cmLocalGenerator *CreateLocalGenerator(); + virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0); /** * Try to determine system information such as shared library diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 76f2e14cc..074c4d141 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -496,9 +496,10 @@ cmGlobalNinjaGenerator::cmGlobalNinjaGenerator() //---------------------------------------------------------------------------- // Virtual public methods. -cmLocalGenerator* cmGlobalNinjaGenerator::CreateLocalGenerator() +cmLocalGenerator* +cmGlobalNinjaGenerator::CreateLocalGenerator(cmLocalGenerator* parent) { - cmLocalGenerator* lg = new cmLocalNinjaGenerator; + cmLocalGenerator* lg = new cmLocalNinjaGenerator(parent); lg->SetGlobalGenerator(this); return lg; } diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 6aa76f988..d7b3adddc 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -171,7 +171,7 @@ public: virtual ~cmGlobalNinjaGenerator() { } /// Overloaded methods. @see cmGlobalGenerator::CreateLocalGenerator() - virtual cmLocalGenerator* CreateLocalGenerator(); + virtual cmLocalGenerator* CreateLocalGenerator(cmLocalGenerator* parent = 0); /// Overloaded methods. @see cmGlobalGenerator::GetName(). virtual std::string GetName() const { diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 8cf6be15b..95998aecb 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -53,9 +53,10 @@ void cmGlobalUnixMakefileGenerator3 } ///! Create a local generator appropriate to this Global Generator -cmLocalGenerator *cmGlobalUnixMakefileGenerator3::CreateLocalGenerator() +cmLocalGenerator * +cmGlobalUnixMakefileGenerator3::CreateLocalGenerator(cmLocalGenerator* parent) { - cmLocalGenerator* lg = new cmLocalUnixMakefileGenerator3; + cmLocalGenerator* lg = new cmLocalUnixMakefileGenerator3(parent); lg->SetGlobalGenerator(this); return lg; } diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index a76a835a7..165a3c8b2 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -68,7 +68,7 @@ public: static void GetDocumentation(cmDocumentationEntry& entry); ///! Create a local generator appropriate to this Global Generator3 - virtual cmLocalGenerator *CreateLocalGenerator(); + virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0); /** * Try to determine system information such as shared library diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 8240099e5..6481ec250 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -308,10 +308,12 @@ void cmGlobalVisualStudio10Generator::WriteSLNHeader(std::ostream& fout) } ///! Create a local generator appropriate to this Global Generator -cmLocalGenerator *cmGlobalVisualStudio10Generator::CreateLocalGenerator() +cmLocalGenerator * +cmGlobalVisualStudio10Generator::CreateLocalGenerator(cmLocalGenerator* parent) { cmLocalVisualStudio10Generator* lg = - new cmLocalVisualStudio10Generator(cmLocalVisualStudioGenerator::VS10); + new cmLocalVisualStudio10Generator(cmLocalVisualStudioGenerator::VS10, + parent); lg->SetGlobalGenerator(this); return lg; } diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index f0dd7d7d2..8cb25884e 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -46,7 +46,7 @@ public: ); ///! create the correct local generator - virtual cmLocalGenerator *CreateLocalGenerator(); + virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0); /** * Try to determine system information such as shared library diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx index 5d3ae16ba..45d6d9544 100644 --- a/Source/cmGlobalVisualStudio11Generator.cxx +++ b/Source/cmGlobalVisualStudio11Generator.cxx @@ -237,10 +237,12 @@ void cmGlobalVisualStudio11Generator::WriteSLNHeader(std::ostream& fout) } //---------------------------------------------------------------------------- -cmLocalGenerator *cmGlobalVisualStudio11Generator::CreateLocalGenerator() +cmLocalGenerator * +cmGlobalVisualStudio11Generator::CreateLocalGenerator(cmLocalGenerator* parent) { cmLocalVisualStudio10Generator* lg = - new cmLocalVisualStudio10Generator(cmLocalVisualStudioGenerator::VS11); + new cmLocalVisualStudio10Generator(cmLocalVisualStudioGenerator::VS11, + parent); lg->SetGlobalGenerator(this); return lg; } diff --git a/Source/cmGlobalVisualStudio11Generator.h b/Source/cmGlobalVisualStudio11Generator.h index 6d434eb75..ae4b888da 100644 --- a/Source/cmGlobalVisualStudio11Generator.h +++ b/Source/cmGlobalVisualStudio11Generator.h @@ -29,7 +29,7 @@ public: virtual void WriteSLNHeader(std::ostream& fout); ///! create the correct local generator - virtual cmLocalGenerator *CreateLocalGenerator(); + virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0); protected: virtual bool InitializeWindowsPhone(cmMakefile* mf); diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx index e70e08297..e298b06dd 100644 --- a/Source/cmGlobalVisualStudio12Generator.cxx +++ b/Source/cmGlobalVisualStudio12Generator.cxx @@ -217,10 +217,12 @@ void cmGlobalVisualStudio12Generator::WriteSLNHeader(std::ostream& fout) } //---------------------------------------------------------------------------- -cmLocalGenerator *cmGlobalVisualStudio12Generator::CreateLocalGenerator() +cmLocalGenerator * +cmGlobalVisualStudio12Generator::CreateLocalGenerator(cmLocalGenerator* parent) { cmLocalVisualStudio10Generator* lg = - new cmLocalVisualStudio10Generator(cmLocalVisualStudioGenerator::VS12); + new cmLocalVisualStudio10Generator(cmLocalVisualStudioGenerator::VS12, + parent); lg->SetGlobalGenerator(this); return lg; } diff --git a/Source/cmGlobalVisualStudio12Generator.h b/Source/cmGlobalVisualStudio12Generator.h index 5e5b5f7b7..d304bc165 100644 --- a/Source/cmGlobalVisualStudio12Generator.h +++ b/Source/cmGlobalVisualStudio12Generator.h @@ -29,7 +29,7 @@ public: virtual void WriteSLNHeader(std::ostream& fout); ///! create the correct local generator - virtual cmLocalGenerator *CreateLocalGenerator(); + virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0); //in Visual Studio 2013 they detached the MSBuild tools version //from the .Net Framework version and instead made it have it's own diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx index 7b1dd247f..6642d8806 100644 --- a/Source/cmGlobalVisualStudio14Generator.cxx +++ b/Source/cmGlobalVisualStudio14Generator.cxx @@ -128,10 +128,12 @@ void cmGlobalVisualStudio14Generator::WriteSLNHeader(std::ostream& fout) } //---------------------------------------------------------------------------- -cmLocalGenerator *cmGlobalVisualStudio14Generator::CreateLocalGenerator() +cmLocalGenerator * +cmGlobalVisualStudio14Generator::CreateLocalGenerator(cmLocalGenerator* parent) { cmLocalVisualStudio10Generator* lg = - new cmLocalVisualStudio10Generator(cmLocalVisualStudioGenerator::VS14); + new cmLocalVisualStudio10Generator(cmLocalVisualStudioGenerator::VS14, + parent); lg->SetGlobalGenerator(this); return lg; } diff --git a/Source/cmGlobalVisualStudio14Generator.h b/Source/cmGlobalVisualStudio14Generator.h index ad1a460be..59f1e602d 100644 --- a/Source/cmGlobalVisualStudio14Generator.h +++ b/Source/cmGlobalVisualStudio14Generator.h @@ -29,7 +29,7 @@ public: virtual void WriteSLNHeader(std::ostream& fout); ///! create the correct local generator - virtual cmLocalGenerator *CreateLocalGenerator(); + virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0); virtual const char* GetToolsVersion() { return "14.0"; } protected: diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx index 0852db63f..55e70b3ba 100644 --- a/Source/cmGlobalVisualStudio6Generator.cxx +++ b/Source/cmGlobalVisualStudio6Generator.cxx @@ -170,9 +170,10 @@ cmGlobalVisualStudio6Generator::GenerateBuildCommand( } ///! Create a local generator appropriate to this Global Generator -cmLocalGenerator *cmGlobalVisualStudio6Generator::CreateLocalGenerator() +cmLocalGenerator * +cmGlobalVisualStudio6Generator::CreateLocalGenerator(cmLocalGenerator* parent) { - cmLocalGenerator *lg = new cmLocalVisualStudio6Generator; + cmLocalGenerator *lg = new cmLocalVisualStudio6Generator(parent); lg->SetGlobalGenerator(this); return lg; } diff --git a/Source/cmGlobalVisualStudio6Generator.h b/Source/cmGlobalVisualStudio6Generator.h index a59a0b2df..d748a8554 100644 --- a/Source/cmGlobalVisualStudio6Generator.h +++ b/Source/cmGlobalVisualStudio6Generator.h @@ -39,7 +39,7 @@ public: static void GetDocumentation(cmDocumentationEntry& entry); ///! Create a local generator appropriate to this Global Generator - virtual cmLocalGenerator *CreateLocalGenerator(); + virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0); /** * Try to determine system information such as shared library diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index a67a64914..db34d44b0 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -25,10 +25,12 @@ cmGlobalVisualStudio71Generator::cmGlobalVisualStudio71Generator( //---------------------------------------------------------------------------- ///! Create a local generator appropriate to this Global Generator -cmLocalGenerator *cmGlobalVisualStudio71Generator::CreateLocalGenerator() +cmLocalGenerator * +cmGlobalVisualStudio71Generator::CreateLocalGenerator(cmLocalGenerator* parent) { cmLocalVisualStudio7Generator *lg = - new cmLocalVisualStudio7Generator(cmLocalVisualStudioGenerator::VS71); + new cmLocalVisualStudio7Generator(cmLocalVisualStudioGenerator::VS71, + parent); lg->SetExtraFlagTable(this->GetExtraFlagTableVS7()); lg->SetGlobalGenerator(this); return lg; diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h index 2b5259a76..ad6c15343 100644 --- a/Source/cmGlobalVisualStudio71Generator.h +++ b/Source/cmGlobalVisualStudio71Generator.h @@ -37,7 +37,7 @@ public: static void GetDocumentation(cmDocumentationEntry& entry); ///! Create a local generator appropriate to this Global Generator - virtual cmLocalGenerator *CreateLocalGenerator(); + virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0); /** * Where does this version of Visual Studio look for macros for the diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 1b031937b..de90f7ead 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -250,10 +250,12 @@ void cmGlobalVisualStudio7Generator::GenerateBuildCommand( } ///! Create a local generator appropriate to this Global Generator -cmLocalGenerator *cmGlobalVisualStudio7Generator::CreateLocalGenerator() +cmLocalGenerator * +cmGlobalVisualStudio7Generator::CreateLocalGenerator(cmLocalGenerator* parent) { cmLocalVisualStudio7Generator *lg = - new cmLocalVisualStudio7Generator(cmLocalVisualStudioGenerator::VS7); + new cmLocalVisualStudio7Generator(cmLocalVisualStudioGenerator::VS7, + parent); lg->SetExtraFlagTable(this->GetExtraFlagTableVS7()); lg->SetGlobalGenerator(this); return lg; diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index d641c025e..92c5f1ae4 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -42,7 +42,7 @@ public: std::string const& GetPlatformName() const; ///! Create a local generator appropriate to this Global Generator - virtual cmLocalGenerator *CreateLocalGenerator(); + virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0); virtual bool SetSystemName(std::string const& s, cmMakefile* mf); diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index bb50633ce..7174f21f9 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -125,10 +125,12 @@ std::string cmGlobalVisualStudio8Generator::FindDevEnvCommand() //---------------------------------------------------------------------------- ///! Create a local generator appropriate to this Global Generator -cmLocalGenerator *cmGlobalVisualStudio8Generator::CreateLocalGenerator() +cmLocalGenerator * +cmGlobalVisualStudio8Generator::CreateLocalGenerator(cmLocalGenerator* parent) { cmLocalVisualStudio7Generator *lg = - new cmLocalVisualStudio7Generator(cmLocalVisualStudioGenerator::VS8); + new cmLocalVisualStudio7Generator(cmLocalVisualStudioGenerator::VS8, + parent); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); lg->SetGlobalGenerator(this); return lg; diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index 4b41ed7d6..ee5ba9f34 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -34,7 +34,7 @@ public: static void GetDocumentation(cmDocumentationEntry& entry); ///! Create a local generator appropriate to this Global Generator - virtual cmLocalGenerator *CreateLocalGenerator(); + virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0); virtual void EnableLanguage(std::vectorconst& languages, cmMakefile *, bool optional); diff --git a/Source/cmGlobalVisualStudio9Generator.cxx b/Source/cmGlobalVisualStudio9Generator.cxx index 1bc627f3c..0303c277c 100644 --- a/Source/cmGlobalVisualStudio9Generator.cxx +++ b/Source/cmGlobalVisualStudio9Generator.cxx @@ -114,10 +114,12 @@ void cmGlobalVisualStudio9Generator::WriteSLNHeader(std::ostream& fout) } ///! Create a local generator appropriate to this Global Generator -cmLocalGenerator *cmGlobalVisualStudio9Generator::CreateLocalGenerator() +cmLocalGenerator * +cmGlobalVisualStudio9Generator::CreateLocalGenerator(cmLocalGenerator* parent) { cmLocalVisualStudio7Generator *lg - = new cmLocalVisualStudio7Generator(cmLocalVisualStudioGenerator::VS9); + = new cmLocalVisualStudio7Generator(cmLocalVisualStudioGenerator::VS9, + parent); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); lg->SetGlobalGenerator(this); return lg; diff --git a/Source/cmGlobalVisualStudio9Generator.h b/Source/cmGlobalVisualStudio9Generator.h index 0a191cde4..97b78041e 100644 --- a/Source/cmGlobalVisualStudio9Generator.h +++ b/Source/cmGlobalVisualStudio9Generator.h @@ -29,7 +29,7 @@ public: static cmGlobalGeneratorFactory* NewFactory(); ///! create the correct local generator - virtual cmLocalGenerator *CreateLocalGenerator(); + virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0); /** * Try to determine system information such as shared library diff --git a/Source/cmGlobalWatcomWMakeGenerator.cxx b/Source/cmGlobalWatcomWMakeGenerator.cxx index e44ed7934..77c64746f 100644 --- a/Source/cmGlobalWatcomWMakeGenerator.cxx +++ b/Source/cmGlobalWatcomWMakeGenerator.cxx @@ -41,9 +41,11 @@ void cmGlobalWatcomWMakeGenerator } ///! Create a local generator appropriate to this Global Generator -cmLocalGenerator *cmGlobalWatcomWMakeGenerator::CreateLocalGenerator() +cmLocalGenerator * +cmGlobalWatcomWMakeGenerator::CreateLocalGenerator(cmLocalGenerator* parent) { - cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3; + cmLocalUnixMakefileGenerator3* lg + = new cmLocalUnixMakefileGenerator3(parent); lg->SetDefineWindowsNULL(true); #ifdef _WIN32 lg->SetWindowsShell(true); diff --git a/Source/cmGlobalWatcomWMakeGenerator.h b/Source/cmGlobalWatcomWMakeGenerator.h index 7bc209bc1..3af2f9d92 100644 --- a/Source/cmGlobalWatcomWMakeGenerator.h +++ b/Source/cmGlobalWatcomWMakeGenerator.h @@ -35,7 +35,7 @@ public: static void GetDocumentation(cmDocumentationEntry& entry); ///! Create a local generator appropriate to this Global Generator - virtual cmLocalGenerator *CreateLocalGenerator(); + virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0); /** * Try to determine system information such as shared library diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index d333c1d87..742750c3d 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -368,9 +368,10 @@ cmGlobalXCodeGenerator::GenerateBuildCommand( //---------------------------------------------------------------------------- ///! Create a local generator appropriate to this Global Generator -cmLocalGenerator *cmGlobalXCodeGenerator::CreateLocalGenerator() +cmLocalGenerator * +cmGlobalXCodeGenerator::CreateLocalGenerator(cmLocalGenerator* parent) { - cmLocalGenerator *lg = new cmLocalXCodeGenerator; + cmLocalGenerator *lg = new cmLocalXCodeGenerator(parent); lg->SetGlobalGenerator(this); return lg; } diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index 1a69fce82..6c911a4d1 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -41,7 +41,7 @@ public: static void GetDocumentation(cmDocumentationEntry& entry); ///! Create a local generator appropriate to this Global Generator - virtual cmLocalGenerator *CreateLocalGenerator(); + virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0); /** * Try to determine system information such as shared library diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index dc7437460..6d1717189 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -43,10 +43,14 @@ #include #endif -cmLocalGenerator::cmLocalGenerator() +cmLocalGenerator::cmLocalGenerator(cmLocalGenerator* parent) { this->Makefile = 0; // moved to after set on global - this->Parent = 0; + this->Parent = parent; + if (parent) + { + parent->AddChild(this); + } this->WindowsShell = false; this->WindowsVSIDE = false; this->WatcomWMake = false; diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index a005f5ffc..befddbf78 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -33,7 +33,7 @@ class cmCustomCommandGenerator; class cmLocalGenerator { public: - cmLocalGenerator(); + cmLocalGenerator(cmLocalGenerator* parent); virtual ~cmLocalGenerator(); /** @@ -131,7 +131,6 @@ public: ///! set/get the parent generator cmLocalGenerator* GetParent() const {return this->Parent;} - void SetParent(cmLocalGenerator* g) { this->Parent = g; g->AddChild(this); } ///! set/get the children void AddChild(cmLocalGenerator* g) { this->Children.push_back(g); } diff --git a/Source/cmLocalGhsMultiGenerator.cxx b/Source/cmLocalGhsMultiGenerator.cxx index a3edc45cd..fa2a1a5f2 100644 --- a/Source/cmLocalGhsMultiGenerator.cxx +++ b/Source/cmLocalGhsMultiGenerator.cxx @@ -16,7 +16,8 @@ #include "cmGhsMultiTargetGenerator.h" #include "cmGeneratedFileStream.h" -cmLocalGhsMultiGenerator::cmLocalGhsMultiGenerator() +cmLocalGhsMultiGenerator::cmLocalGhsMultiGenerator(cmLocalGenerator* parent) + : cmLocalGenerator(parent) { } diff --git a/Source/cmLocalGhsMultiGenerator.h b/Source/cmLocalGhsMultiGenerator.h index a8df3e7aa..7afef5600 100644 --- a/Source/cmLocalGhsMultiGenerator.h +++ b/Source/cmLocalGhsMultiGenerator.h @@ -25,7 +25,7 @@ class cmGeneratedFileStream; class cmLocalGhsMultiGenerator : public cmLocalGenerator { public: - cmLocalGhsMultiGenerator(); + cmLocalGhsMultiGenerator(cmLocalGenerator* parent); virtual ~cmLocalGhsMultiGenerator(); diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index d4741a095..4e817a09a 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -22,8 +22,8 @@ #include -cmLocalNinjaGenerator::cmLocalNinjaGenerator() - : cmLocalGenerator() +cmLocalNinjaGenerator::cmLocalNinjaGenerator(cmLocalGenerator* parent) + : cmLocalGenerator(parent) , ConfigName("") , HomeRelativeOutputPath("") { diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h index 01e16df49..d72677b3a 100644 --- a/Source/cmLocalNinjaGenerator.h +++ b/Source/cmLocalNinjaGenerator.h @@ -32,7 +32,7 @@ class cmLocalNinjaGenerator : public cmLocalGenerator { public: /// Default constructor. - cmLocalNinjaGenerator(); + cmLocalNinjaGenerator(cmLocalGenerator* parent); /// Destructor. virtual ~cmLocalNinjaGenerator(); diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index f66b54a9a..bf6fb6140 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -79,7 +79,9 @@ static std::string cmSplitExtension(std::string const& in, std::string& base) } //---------------------------------------------------------------------------- -cmLocalUnixMakefileGenerator3::cmLocalUnixMakefileGenerator3() +cmLocalUnixMakefileGenerator3:: +cmLocalUnixMakefileGenerator3(cmLocalGenerator* parent) + : cmLocalGenerator(parent) { this->WindowsShell = false; this->IncludeDirective = "include"; diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h index a2f424532..9f83b8641 100644 --- a/Source/cmLocalUnixMakefileGenerator3.h +++ b/Source/cmLocalUnixMakefileGenerator3.h @@ -34,7 +34,7 @@ class cmSourceFile; class cmLocalUnixMakefileGenerator3 : public cmLocalGenerator { public: - cmLocalUnixMakefileGenerator3(); + cmLocalUnixMakefileGenerator3(cmLocalGenerator* parent); virtual ~cmLocalUnixMakefileGenerator3(); /** diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx index 2b6756233..73a4ec852 100644 --- a/Source/cmLocalVisualStudio10Generator.cxx +++ b/Source/cmLocalVisualStudio10Generator.cxx @@ -61,8 +61,9 @@ class cmVS10XMLParser : public cmXMLParser //---------------------------------------------------------------------------- -cmLocalVisualStudio10Generator::cmLocalVisualStudio10Generator(VSVersion v): - cmLocalVisualStudio7Generator(v) +cmLocalVisualStudio10Generator +::cmLocalVisualStudio10Generator(VSVersion v, cmLocalGenerator* parent): + cmLocalVisualStudio7Generator(v, parent) { } diff --git a/Source/cmLocalVisualStudio10Generator.h b/Source/cmLocalVisualStudio10Generator.h index b50e3458b..f90daa06c 100644 --- a/Source/cmLocalVisualStudio10Generator.h +++ b/Source/cmLocalVisualStudio10Generator.h @@ -25,7 +25,7 @@ class cmLocalVisualStudio10Generator : public cmLocalVisualStudio7Generator { public: ///! Set cache only and recurse to false by default. - cmLocalVisualStudio10Generator(VSVersion v); + cmLocalVisualStudio10Generator(VSVersion v, cmLocalGenerator* parent); virtual ~cmLocalVisualStudio10Generator(); diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index 69da9fb3b..6d89b15d1 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -23,8 +23,9 @@ #include #include -cmLocalVisualStudio6Generator::cmLocalVisualStudio6Generator(): - cmLocalVisualStudioGenerator(VS6) +cmLocalVisualStudio6Generator +::cmLocalVisualStudio6Generator(cmLocalGenerator* parent): + cmLocalVisualStudioGenerator(VS6, parent) { } diff --git a/Source/cmLocalVisualStudio6Generator.h b/Source/cmLocalVisualStudio6Generator.h index 47718337b..1a0a61443 100644 --- a/Source/cmLocalVisualStudio6Generator.h +++ b/Source/cmLocalVisualStudio6Generator.h @@ -29,7 +29,7 @@ class cmLocalVisualStudio6Generator : public cmLocalVisualStudioGenerator { public: ///! Set cache only and recurse to false by default. - cmLocalVisualStudio6Generator(); + cmLocalVisualStudio6Generator(cmLocalGenerator* parent); virtual ~cmLocalVisualStudio6Generator(); diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 928481caa..2152f7713 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -54,8 +54,9 @@ static void cmConvertToWindowsSlash(std::string& s) } //---------------------------------------------------------------------------- -cmLocalVisualStudio7Generator::cmLocalVisualStudio7Generator(VSVersion v): - cmLocalVisualStudioGenerator(v) +cmLocalVisualStudio7Generator +::cmLocalVisualStudio7Generator(VSVersion v, cmLocalGenerator* parent): + cmLocalVisualStudioGenerator(v, parent) { this->ExtraFlagTable = 0; this->Internal = new cmLocalVisualStudio7GeneratorInternals(this); diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h index c2caa26f3..cfbc63c9f 100644 --- a/Source/cmLocalVisualStudio7Generator.h +++ b/Source/cmLocalVisualStudio7Generator.h @@ -35,7 +35,7 @@ class cmLocalVisualStudio7Generator : public cmLocalVisualStudioGenerator { public: ///! Set cache only and recurse to false by default. - cmLocalVisualStudio7Generator(VSVersion v); + cmLocalVisualStudio7Generator(VSVersion v, cmLocalGenerator* parent); virtual ~cmLocalVisualStudio7Generator(); diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx index f01aa6ba8..854ad34f6 100644 --- a/Source/cmLocalVisualStudioGenerator.cxx +++ b/Source/cmLocalVisualStudioGenerator.cxx @@ -18,7 +18,9 @@ #include "windows.h" //---------------------------------------------------------------------------- -cmLocalVisualStudioGenerator::cmLocalVisualStudioGenerator(VSVersion v) +cmLocalVisualStudioGenerator +::cmLocalVisualStudioGenerator(VSVersion v, cmLocalGenerator* parent) + : cmLocalGenerator(parent) { this->WindowsShell = true; this->WindowsVSIDE = true; diff --git a/Source/cmLocalVisualStudioGenerator.h b/Source/cmLocalVisualStudioGenerator.h index d26c2eaf0..562d595ba 100644 --- a/Source/cmLocalVisualStudioGenerator.h +++ b/Source/cmLocalVisualStudioGenerator.h @@ -45,7 +45,7 @@ public: VS14 = 140 }; - cmLocalVisualStudioGenerator(VSVersion v); + cmLocalVisualStudioGenerator(VSVersion v, cmLocalGenerator* parent); virtual ~cmLocalVisualStudioGenerator(); /** Construct a script from the given list of command lines. */ diff --git a/Source/cmLocalXCodeGenerator.cxx b/Source/cmLocalXCodeGenerator.cxx index 8ff6c87d6..1d3a8cfac 100644 --- a/Source/cmLocalXCodeGenerator.cxx +++ b/Source/cmLocalXCodeGenerator.cxx @@ -15,7 +15,8 @@ #include "cmMakefile.h" //---------------------------------------------------------------------------- -cmLocalXCodeGenerator::cmLocalXCodeGenerator() +cmLocalXCodeGenerator::cmLocalXCodeGenerator(cmLocalGenerator* parent) + : cmLocalGenerator(parent) { // the global generator does this, so do not // put these flags into the language flags diff --git a/Source/cmLocalXCodeGenerator.h b/Source/cmLocalXCodeGenerator.h index f553a17ef..1a5760f02 100644 --- a/Source/cmLocalXCodeGenerator.h +++ b/Source/cmLocalXCodeGenerator.h @@ -24,7 +24,7 @@ class cmLocalXCodeGenerator : public cmLocalGenerator { public: ///! Set cache only and recurse to false by default. - cmLocalXCodeGenerator(); + cmLocalXCodeGenerator(cmLocalGenerator* parent); virtual ~cmLocalXCodeGenerator(); virtual std::string GetTargetDirectory(cmTarget const& target) const; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 4c68849fe..a00b8eb61 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1617,8 +1617,8 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath, // create a new local generator and set its parent cmLocalGenerator *lg2 = - this->LocalGenerator->GetGlobalGenerator()->CreateLocalGenerator(); - lg2->SetParent(this->LocalGenerator); + this->LocalGenerator->GetGlobalGenerator() + ->CreateLocalGenerator(this->LocalGenerator); this->LocalGenerator->GetGlobalGenerator()->AddLocalGenerator(lg2); // set the subdirs start dirs