From bbef3c2da83b7a69d1f99b21dc92d5506d98fb35 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 25 Sep 2015 00:13:20 +0200 Subject: cmLocalGenerator: Add current binary directory accessor. --- Source/cmDependsFortran.cxx | 2 +- Source/cmExtraCodeBlocksGenerator.cxx | 14 ++++++-------- Source/cmExtraCodeLiteGenerator.cxx | 12 +++++------- Source/cmExtraEclipseCDT4Generator.cxx | 7 +++---- Source/cmExtraKateGenerator.cxx | 2 +- Source/cmExtraSublimeTextGenerator.cxx | 3 +-- Source/cmGlobalKdevelopGenerator.cxx | 3 +-- Source/cmGlobalUnixMakefileGenerator3.cxx | 8 ++++---- Source/cmGlobalVisualStudio7Generator.cxx | 8 +++++--- Source/cmGlobalXCodeGenerator.cxx | 26 +++++++++++++------------- Source/cmInstallExportGenerator.cxx | 2 +- Source/cmLocalGenerator.cxx | 5 +++++ Source/cmLocalGenerator.h | 2 ++ Source/cmLocalNinjaGenerator.cxx | 2 +- Source/cmLocalVisualStudio6Generator.cxx | 16 ++++++++-------- Source/cmLocalVisualStudio7Generator.cxx | 16 ++++++++-------- Source/cmMakefileTargetGenerator.cxx | 15 ++++++++------- Source/cmVisualStudio10TargetGenerator.cxx | 14 +++++++------- 18 files changed, 80 insertions(+), 77 deletions(-) diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index 856dcd4..80f560f 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -160,7 +160,7 @@ bool cmDependsFortran::Finalize(std::ostream& makeDepends, if (mod_dir.empty()) { mod_dir = - this->LocalGenerator->GetMakefile()->GetCurrentBinaryDirectory(); + this->LocalGenerator->GetCurrentBinaryDirectory(); } // Actually write dependencies to the streams. diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index b7ada2f..c9d0ce2 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -76,8 +76,7 @@ void cmExtraCodeBlocksGenerator::Generate() void cmExtraCodeBlocksGenerator::CreateProjectFile( const std::vector& lgs) { - const cmMakefile* mf=lgs[0]->GetMakefile(); - std::string outputDir=mf->GetCurrentBinaryDirectory(); + std::string outputDir=lgs[0]->GetCurrentBinaryDirectory(); std::string projectName=lgs[0]->GetProjectName(); std::string filename=outputDir+"/"; @@ -331,7 +330,7 @@ void cmExtraCodeBlocksGenerator { // Only add the global targets from CMAKE_BINARY_DIR, // not from the subdirs - if (strcmp(makefile->GetCurrentBinaryDirectory(), + if (strcmp((*lg)->GetCurrentBinaryDirectory(), (*lg)->GetBinaryDirectory())==0) { this->AppendTarget(fout, ti->first, 0, @@ -524,11 +523,10 @@ std::string cmExtraCodeBlocksGenerator::CreateDummyTargetFile( cmLocalGenerator* lg, cmTarget* target) const { - cmMakefile *mf = lg->GetMakefile(); // this file doesn't seem to be used by C::B in custom makefile mode, // but we generate a unique file for each OBJECT library so in case // C::B uses it in some way, the targets don't interfere with each other. - std::string filename = mf->GetCurrentBinaryDirectory(); + std::string filename = lg->GetCurrentBinaryDirectory(); filename += "/"; filename += lg->GetTargetDirectory(*target); filename += "/"; @@ -555,14 +553,14 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout, const char* compiler) { cmMakefile const* makefile = lg->GetMakefile(); - std::string makefileName = makefile->GetCurrentBinaryDirectory(); + std::string makefileName = lg->GetCurrentBinaryDirectory(); makefileName += "/Makefile"; fout<<" \n"; if (target!=0) { int cbTargetType = this->GetCBTargetType(target); - std::string workingDir = makefile->GetCurrentBinaryDirectory(); + std::string workingDir = lg->GetCurrentBinaryDirectory(); if ( target->GetType()==cmTarget::EXECUTABLE) { // Determine the directory where the executable target is created, and @@ -659,7 +657,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout, else // e.g. all and the GLOBAL and UTILITY targets { fout<<"