From 27916f2cd10904deda1a44bf221fbdef7ba1af66 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 7 Oct 2015 00:37:31 +0200 Subject: cmLocalGenerator: Add cmake instance accessor. --- Source/cmLocalGenerator.cxx | 5 +++++ Source/cmLocalGenerator.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index b26151c..6647894 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2858,6 +2858,11 @@ cmLocalGenerator return source.GetLanguage(); } +cmake* cmLocalGenerator::GetCMakeInstance() const +{ + return this->GlobalGenerator->GetCMakeInstance(); +} + //---------------------------------------------------------------------------- std::string cmLocalGenerator::GetTargetDirectory(cmTarget const&) const diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 33fede1..d9623cb 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -251,6 +251,8 @@ public: */ bool NeedBackwardsCompatibility_2_4(); + cmake* GetCMakeInstance() const; + /** * Generate a Mac OS X application bundle Info.plist file. */ -- cgit v0.12 From 8c6e6dd3cef0befcd9a7f4c410a49a5afddd8afb Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 7 Oct 2015 00:17:20 +0200 Subject: cmMakefile: Inline initialization of project name. --- Source/cmMakefile.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index c060505..16c0c9a 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1529,7 +1529,7 @@ void cmMakefile::InitializeFromParent(cmMakefile* parent) parent->GetProperty("LINK_DIRECTORIES")); // the initial project name - this->SetProjectName(parent->GetProjectName()); + this->StateSnapshot.SetProjectName(parent->StateSnapshot.GetProjectName()); // Copy include regular expressions. this->ComplainFileRegularExpression = parent->ComplainFileRegularExpression; -- cgit v0.12 From c8187f414bcc4668940c2e0fe40d361389efdbe5 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 7 Oct 2015 00:19:02 +0200 Subject: cmCPluginAPI: Inline code to get project name. --- Source/cmCPluginAPI.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index 7da334e..e3efcdd 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -116,7 +116,7 @@ const char* CCONV cmGetProjectName(void *arg) { cmMakefile *mf = static_cast(arg); static std::string name; - name = mf->GetProjectName(); + name = mf->GetStateSnapshot().GetProjectName(); return name.c_str(); } -- cgit v0.12 From 4ab2750c54adb09d147839687858aabe3cd988a7 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 7 Oct 2015 00:29:25 +0200 Subject: cmLocalGenerator: Add GetProjectName method. --- Source/cmExtraCodeBlocksGenerator.cxx | 4 ++-- Source/cmExtraCodeLiteGenerator.cxx | 8 ++++---- Source/cmExtraEclipseCDT4Generator.cxx | 19 +++++++++---------- Source/cmExtraKateGenerator.cxx | 6 +++--- Source/cmExtraSublimeTextGenerator.cxx | 4 ++-- Source/cmGlobalKdevelopGenerator.cxx | 2 +- Source/cmGlobalVisualStudio6Generator.cxx | 2 +- Source/cmGlobalVisualStudio7Generator.cxx | 4 ++-- Source/cmGlobalVisualStudioGenerator.cxx | 2 +- Source/cmGlobalXCodeGenerator.cxx | 6 +++--- Source/cmLocalGenerator.cxx | 5 +++++ Source/cmLocalGenerator.h | 2 ++ Source/cmLocalNinjaGenerator.cxx | 2 +- 13 files changed, 36 insertions(+), 30 deletions(-) diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 7915a6e..103c16a 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -78,7 +78,7 @@ void cmExtraCodeBlocksGenerator::CreateProjectFile( { const cmMakefile* mf=lgs[0]->GetMakefile(); std::string outputDir=mf->GetCurrentBinaryDirectory(); - std::string projectName=mf->GetProjectName(); + std::string projectName=lgs[0]->GetProjectName(); std::string filename=outputDir+"/"; filename+=projectName+".cbp"; @@ -307,7 +307,7 @@ void cmExtraCodeBlocksGenerator "\n" " \n" " \n" - "