[Cmake-commits] CMake branch, next, updated. v3.4.0-rc1-180-gf6043d5

Stephen Kelly steveire at gmail.com
Wed Oct 7 16:01:36 EDT 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  f6043d59e60d6aa4eb12cb091d4b906e01c4b607 (commit)
       via  56d29100ac34778a35c56740234ec2f837508f34 (commit)
       via  bf2a0a5aea5fd218de25f07450a7a69e3f3adcd7 (commit)
       via  eb68b0e5da527904d72b81e693624e7d9c697dd5 (commit)
       via  fd6692825f5e4b9787746e2811a8a53e33886138 (commit)
       via  8029773fbd01c8dafe1a6f7e0136ae9b7a5339e1 (commit)
       via  f1de916fda8bb37780f8c7ceb01517400ca718e6 (commit)
       via  5ce9220ececf0f71f9c2f14ed1b02e67ffefb56e (commit)
      from  51b5214b4bd684bb6beddafc30a94f27dbcaf251 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f6043d59e60d6aa4eb12cb091d4b906e01c4b607
commit f6043d59e60d6aa4eb12cb091d4b906e01c4b607
Merge: 51b5214 56d2910
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 7 16:01:34 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Oct 7 16:01:34 2015 -0400

    Merge topic 'add-cmLocalGenerator-API' into next
    
    56d29100 Revert "cmLocalGenerator: Add Home directory accessors."
    bf2a0a5a Revert "cmLocalGenerator: Add current binary directory accessor."
    eb68b0e5 Revert "cmLocalGenerator: Add current source directory accessor."
    fd669282 Remove some needless GetMakefile() calls.
    8029773f cmLocalGenerator: Add current source directory accessor.
    f1de916f cmLocalGenerator: Add current binary directory accessor.
    5ce9220e cmLocalGenerator: Add Home directory accessors.


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=56d29100ac34778a35c56740234ec2f837508f34
commit 56d29100ac34778a35c56740234ec2f837508f34
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 7 22:01:04 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Oct 7 22:01:04 2015 +0200

    Revert "cmLocalGenerator: Add Home directory accessors."
    
    This reverts commit 5ce9220ececf0f71f9c2f14ed1b02e67ffefb56e.

diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index e97069f..d35b566 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -1975,9 +1975,8 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
       else if(use_link_rpath)
         {
         // Do not add any path inside the source or build tree.
-        const char* topSourceDir = this->CMakeInstance->GetHomeDirectory();
-        const char* topBinaryDir =
-            this->CMakeInstance->GetHomeOutputDirectory();
+        const char* topSourceDir = this->Makefile->GetHomeDirectory();
+        const char* topBinaryDir = this->Makefile->GetHomeOutputDirectory();
         if(!cmSystemTools::ComparePath(*ri, topSourceDir) &&
            !cmSystemTools::ComparePath(*ri, topBinaryDir) &&
            !cmSystemTools::IsSubDirectory(*ri, topSourceDir) &&
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index c9b6100..2a9b72c 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -245,10 +245,8 @@ static bool checkInterfaceDirs(const std::string &prepro,
 {
   const char* installDir =
             target->Makefile->GetSafeDefinition("CMAKE_INSTALL_PREFIX");
-  const char* topSourceDir =
-      target->GetLocalGenerator()->GetSourceDirectory();
-  const char* topBinaryDir =
-      target->GetLocalGenerator()->GetBinaryDirectory();
+  const char* topSourceDir = target->Makefile->GetHomeDirectory();
+  const char* topBinaryDir = target->Makefile->GetHomeOutputDirectory();
 
   std::vector<std::string> parts;
   cmGeneratorExpression::Split(prepro, parts);
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 883b287..408daab 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -273,7 +273,7 @@ void cmExtraCodeBlocksGenerator
         }
 
       const std::string &relative = cmSystemTools::RelativePath(
-                         it->second[0]->GetSourceDirectory(),
+                         it->second[0]->GetMakefile()->GetHomeDirectory(),
                          jt->c_str());
       std::vector<std::string> splitted;
       cmSystemTools::SplitPath(relative, splitted, false);
@@ -297,7 +297,7 @@ void cmExtraCodeBlocksGenerator
   tree.BuildVirtualFolder(virtualFolders);
   // And one for <Unit>
   std::string unitFiles;
-  tree.BuildUnit(unitFiles, std::string(lgs[0]->GetSourceDirectory()) + "/");
+  tree.BuildUnit(unitFiles, std::string(mf->GetHomeDirectory()) + "/");
 
   // figure out the compiler
   std::string compiler = this->GetCBCompilerId(mf);
@@ -332,7 +332,7 @@ void cmExtraCodeBlocksGenerator
           // Only add the global targets from CMAKE_BINARY_DIR,
           // not from the subdirs
           if (strcmp(makefile->GetCurrentBinaryDirectory(),
-                     (*lg)->GetBinaryDirectory())==0)
+                     makefile->GetHomeOutputDirectory())==0)
             {
             this->AppendTarget(fout, ti->first, 0,
                                make.c_str(), *lg, compiler.c_str());
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index 763673e..1884da1 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -69,11 +69,11 @@ void cmExtraCodeLiteGenerator::Generate()
     this->ConfigName = GetConfigurationName( mf );
 
     if (strcmp(mf->GetCurrentBinaryDirectory(),
-               it->second[0]->GetBinaryDirectory()) == 0)
+               mf->GetHomeOutputDirectory()) == 0)
       {
       workspaceOutputDir   = mf->GetCurrentBinaryDirectory();
       workspaceProjectName = it->second[0]->GetProjectName();
-      workspaceSourcePath  = it->second[0]->GetSourceDirectory();
+      workspaceSourcePath  = mf->GetHomeDirectory();
       workspaceFileName    = workspaceOutputDir+"/";
       workspaceFileName   += workspaceProjectName + ".workspace";
       this->WorkspacePath = mf->GetCurrentBinaryDirectory();;
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 214e89f..659a9ae 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -79,8 +79,8 @@ void cmExtraEclipseCDT4Generator
 //----------------------------------------------------------------------------
 void cmExtraEclipseCDT4Generator::Generate()
 {
-  cmLocalGenerator* lg = this->GlobalGenerator->GetLocalGenerators()[0];
-  const cmMakefile* mf = lg->GetMakefile();
+  const cmMakefile* mf
+    = this->GlobalGenerator->GetLocalGenerators()[0]->GetMakefile();
 
   std::string eclipseVersion = mf->GetSafeDefinition("CMAKE_ECLIPSE_VERSION");
   cmsys::RegularExpression regex(".*([0-9]+\\.[0-9]+).*");
@@ -106,8 +106,8 @@ void cmExtraEclipseCDT4Generator::Generate()
     }
 
   // TODO: Decide if these are local or member variables
-  this->HomeDirectory       = lg->GetSourceDirectory();
-  this->HomeOutputDirectory = lg->GetBinaryDirectory();
+  this->HomeDirectory       = mf->GetHomeDirectory();
+  this->HomeOutputDirectory = mf->GetHomeOutputDirectory();
 
   this->GenerateLinkedResources = mf->IsOn(
                                     "CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES");
@@ -226,7 +226,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout,
     mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(),
                            cacheEntryName.c_str(), cmState::STRING,
                            true);
-    mf->GetCMakeInstance()->SaveCache(lg->GetBinaryDirectory());
+    mf->GetCMakeInstance()->SaveCache(mf->GetHomeOutputDirectory());
     }
   else if (envVarValue==0 && cacheValue!=0)
     {
@@ -247,7 +247,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout,
       mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(),
                              cacheEntryName.c_str(), cmState::STRING,
                              true);
-      mf->GetCMakeInstance()->SaveCache(lg->GetBinaryDirectory());
+      mf->GetCMakeInstance()->SaveCache(mf->GetHomeOutputDirectory());
       }
     }
 
@@ -1089,7 +1089,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
           virtDir += prefix;
           virtDir += ti->first;
           std::string buildArgs = "-C \"";
-          buildArgs += (*it)->GetBinaryDirectory();
+          buildArgs += makefile->GetHomeOutputDirectory();
           buildArgs += "\" ";
           buildArgs += makeArgs;
           this->AppendTarget(fout, "Build", make, buildArgs, virtDir, "",
diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx
index f14a1cc..104372c 100644
--- a/Source/cmExtraKateGenerator.cxx
+++ b/Source/cmExtraKateGenerator.cxx
@@ -50,7 +50,7 @@ void cmExtraKateGenerator::Generate()
   const cmMakefile* mf = lg->GetMakefile();
   this->ProjectName = this->GenerateProjectName(lg->GetProjectName(),
                           mf->GetSafeDefinition("CMAKE_BUILD_TYPE"),
-                          this->GetPathBasename(lg->GetBinaryDirectory()));
+                          this->GetPathBasename(mf->GetHomeOutputDirectory()));
   this->UseNinja = (this->GlobalGenerator->GetName() == "Ninja");
 
   this->CreateKateProjectFile(lg);
@@ -61,7 +61,8 @@ void cmExtraKateGenerator::Generate()
 void cmExtraKateGenerator::CreateKateProjectFile(
     const cmLocalGenerator* lg) const
 {
-  std::string filename = lg->GetBinaryDirectory();
+  const cmMakefile* mf = lg->GetMakefile();
+  std::string filename = mf->GetHomeOutputDirectory();
   filename += "/.kateproject";
   cmGeneratedFileStream fout(filename.c_str());
   if (!fout)
@@ -72,9 +73,9 @@ void cmExtraKateGenerator::CreateKateProjectFile(
   fout <<
     "{\n"
     "\t\"name\": \"" << this->ProjectName << "\",\n"
-    "\t\"directory\": \"" << lg->GetSourceDirectory() << "\",\n"
-    "\t\"files\": [ { " << this->GenerateFilesString(lg) << "} ],\n";
-  this->WriteTargets(lg, fout);
+    "\t\"directory\": \"" << mf->GetHomeDirectory() << "\",\n"
+    "\t\"files\": [ { " << this->GenerateFilesString(mf) << "} ],\n";
+  this->WriteTargets(mf, fout);
   fout << "}\n";
 }
 
@@ -83,15 +84,15 @@ void
 cmExtraKateGenerator::WriteTargets(const cmLocalGenerator* lg,
                                    cmGeneratedFileStream& fout) const
 {
-  cmMakefile const* mf = lg->GetMakefile();
+  cmMakefile* mf = lg->GetMakefile();
   const std::string make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM");
   const std::string makeArgs = mf->GetSafeDefinition(
     "CMAKE_KATE_MAKE_ARGUMENTS");
-  const char* homeOutputDir = lg->GetBinaryDirectory();
+  const char* homeOutputDir = mf->GetHomeOutputDirectory();
 
   fout <<
   "\t\"build\": {\n"
-  "\t\t\"directory\": \"" << lg->GetBinaryDirectory() << "\",\n"
+  "\t\t\"directory\": \"" << mf->GetHomeOutputDirectory() << "\",\n"
   "\t\t\"default_target\": \"all\",\n"
   "\t\t\"clean_target\": \"clean\",\n";
 
@@ -122,7 +123,7 @@ cmExtraKateGenerator::WriteTargets(const cmLocalGenerator* lg,
     const cmTargets& targets = (*it)->GetMakefile()->GetTargets();
     cmMakefile* makefile=(*it)->GetMakefile();
     std::string currentDir = makefile->GetCurrentBinaryDirectory();
-    bool topLevel = (currentDir == (*it)->GetBinaryDirectory());
+    bool topLevel = (currentDir == makefile->GetHomeOutputDirectory());
 
     for(cmTargets::const_iterator ti=targets.begin(); ti!=targets.end(); ++ti)
       {
@@ -236,7 +237,8 @@ void
 cmExtraKateGenerator::CreateDummyKateProjectFile(
     const cmLocalGenerator* lg) const
 {
-  std::string filename = lg->GetBinaryDirectory();
+  cmMakefile* mf = lg->GetMakefile();
+  std::string filename = mf->GetHomeOutputDirectory();
   filename += "/";
   filename += this->ProjectName;
   filename += ".kateproject";
@@ -254,21 +256,22 @@ cmExtraKateGenerator::CreateDummyKateProjectFile(
 std::string
 cmExtraKateGenerator::GenerateFilesString(const cmLocalGenerator* lg) const
 {
-  std::string s = lg->GetSourceDirectory();
+  cmMakefile* mf = lg->GetMakefile();
+  std::string s = mf->GetHomeDirectory();
   s += "/.git";
   if(cmSystemTools::FileExists(s.c_str()))
   {
     return std::string("\"git\": 1 ");
   }
 
-  s = lg->GetSourceDirectory();
+  s = mf->GetHomeDirectory();
   s += "/.svn";
   if(cmSystemTools::FileExists(s.c_str()))
   {
     return std::string("\"svn\": 1 ");
   }
 
-  s = lg->GetSourceDirectory();
+  s = mf->GetHomeDirectory();
   s += "/";
 
   std::set<std::string> files;
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index 21587d6..363ab2f 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -99,8 +99,8 @@ void cmExtraSublimeTextGenerator
     }
 
   const std::string &sourceRootRelativeToOutput = cmSystemTools::RelativePath(
-                     lgs[0]->GetBinaryDirectory(),
-                     lgs[0]->GetSourceDirectory());
+                     mf->GetHomeOutputDirectory(),
+                     mf->GetHomeDirectory());
   // Write the folder entries to the project file
   fout << "{\n";
   fout << "\t\"folders\":\n\t[\n\t";
@@ -108,8 +108,8 @@ void cmExtraSublimeTextGenerator
     {
       fout << "\t{\n\t\t\t\"path\": \"" << sourceRootRelativeToOutput << "\"";
       const std::string &outputRelativeToSourceRoot =
-        cmSystemTools::RelativePath(lgs[0]->GetSourceDirectory(),
-                                    lgs[0]->GetBinaryDirectory());
+        cmSystemTools::RelativePath(mf->GetHomeDirectory(),
+                                    mf->GetHomeOutputDirectory());
       if ((!outputRelativeToSourceRoot.empty()) &&
         ((outputRelativeToSourceRoot.length() < 3) ||
           (outputRelativeToSourceRoot.substr(0, 3) != "../")))
@@ -173,8 +173,8 @@ void cmExtraSublimeTextGenerator::
           {
           // Only add the global targets from CMAKE_BINARY_DIR,
           // not from the subdirs
-          if (strcmp((*lg)->GetCurrentBinaryDirectory(),
-                     (*lg)->GetBinaryDirectory())==0)
+          if (strcmp(makefile->GetCurrentBinaryDirectory(),
+                     makefile->GetHomeOutputDirectory())==0)
             {
             this->AppendTarget(fout, ti->first, *lg, 0,
                                make.c_str(), makefile, compiler.c_str(),
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 4a362d8..cae5c2f 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -68,9 +68,7 @@ cmGhsMultiTargetGenerator::GetRelBuildFilePath(const cmTarget *target)
 std::string
 cmGhsMultiTargetGenerator::GetAbsPathToRoot(const cmTarget *target)
 {
-  cmGeneratorTarget* gt = target->GetMakefile()->GetGlobalGenerator()
-      ->GetGeneratorTarget(target);
-  return gt->GetLocalGenerator()->GetBinaryDirectory();
+  return target->GetMakefile()->GetHomeOutputDirectory();
 }
 
 std::string
@@ -451,7 +449,7 @@ void cmGhsMultiTargetGenerator::WriteSources(
     cmSystemTools::ConvertToUnixSlashes(sgPath);
     cmGlobalGhsMultiGenerator::AddFilesUpToPath(
       this->GetFolderBuildStreams(), &this->FolderBuildStreams,
-      this->LocalGenerator->GetBinaryDirectory(), sgPath,
+      this->Makefile->GetHomeOutputDirectory(), sgPath,
       GhsMultiGpj::SUBPROJECT, this->RelBuildFilePath);
 
     std::string fullSourcePath((*si)->GetFullPath());
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 57a8741..05f1029 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -399,7 +399,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
   bool fatalError = false;
 
   mf->AddDefinition("RUN_CONFIGURE", true);
-  std::string rootBin = this->CMakeInstance->GetHomeOutputDirectory();
+  std::string rootBin = mf->GetHomeOutputDirectory();
   rootBin += cmake::GetCMakeFilesDirectory();
 
   // If the configuration files path has been set,
@@ -2879,8 +2879,10 @@ void cmGlobalGenerator::WriteRuleHashes(std::string const& pfile)
 //----------------------------------------------------------------------------
 void cmGlobalGenerator::WriteSummary()
 {
+  cmMakefile* mf = this->LocalGenerators[0]->GetMakefile();
+
   // Record all target directories in a central location.
-  std::string fname = this->CMakeInstance->GetHomeOutputDirectory();
+  std::string fname = mf->GetHomeOutputDirectory();
   fname += cmake::GetCMakeFilesDirectory();
   fname += "/TargetDirectories.txt";
   cmGeneratedFileStream fout(fname.c_str());
diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx
index f82fcb3..6290907 100644
--- a/Source/cmGlobalKdevelopGenerator.cxx
+++ b/Source/cmGlobalKdevelopGenerator.cxx
@@ -51,7 +51,7 @@ void cmGlobalKdevelopGenerator::Generate()
     {
     cmMakefile* mf = it->second[0]->GetMakefile();
     std::string outputDir=mf->GetCurrentBinaryDirectory();
-    std::string projectDir=it->second[0]->GetSourceDirectory();
+    std::string projectDir=mf->GetHomeDirectory();
     std::string projectName=it->second[0]->GetProjectName();
     std::string cmakeFilePattern("CMakeLists.txt;*.cmake;");
     std::string fileToOpen;
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 32e6077..9d8193b 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -1198,15 +1198,16 @@ void cmGlobalNinjaGenerator::WriteTargetAll(std::ostream& os)
 void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
 {
   cmLocalGenerator *lg = this->LocalGenerators[0];
+  cmMakefile* mfRoot = lg->GetMakefile();
 
   std::ostringstream cmd;
   cmd << lg->ConvertToOutputFormat(cmSystemTools::GetCMakeCommand(),
                                    cmLocalGenerator::SHELL)
       << " -H"
-      << lg->ConvertToOutputFormat(lg->GetSourceDirectory(),
+      << lg->ConvertToOutputFormat(mfRoot->GetHomeDirectory(),
                                    cmLocalGenerator::SHELL)
       << " -B"
-      << lg->ConvertToOutputFormat(lg->GetBinaryDirectory(),
+      << lg->ConvertToOutputFormat(mfRoot->GetHomeOutputDirectory(),
                                    cmLocalGenerator::SHELL);
   WriteRule(*this->RulesFileStream,
             "RERUN_CMAKE",
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 2fdc18f..73bcd2b 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -785,7 +785,7 @@ cmGlobalUnixMakefileGenerator3
       depends.clear();
 
       cmLocalUnixMakefileGenerator3::EchoProgress progress;
-      progress.Dir = lg->GetBinaryDirectory();
+      progress.Dir = lg->GetMakefile()->GetHomeOutputDirectory();
       progress.Dir += cmake::GetCMakeFilesDirectory();
       {
       std::ostringstream progressArg;
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 0a6844e..86a8f87 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -312,10 +312,10 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget()
   cmCustomCommandLine commandLine;
   commandLine.push_back(cmSystemTools::GetCMakeCommand());
   std::string argH = "-H";
-  argH += lg->GetSourceDirectory();
+  argH += mf->GetHomeDirectory();
   commandLine.push_back(argH);
   std::string argB = "-B";
-  argB += lg->GetBinaryDirectory();
+  argB += mf->GetHomeOutputDirectory();
   commandLine.push_back(argB);
   commandLine.push_back("--check-stamp-list");
   commandLine.push_back(stampList.c_str());
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index b40d5b7..840e89f 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -588,7 +588,7 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile(
     (this->CurrentReRunCMakeMakefile.c_str());
   makefileStream.SetCopyIfDifferent(true);
   makefileStream << "# Generated by CMake, DO NOT EDIT\n";
-  std::string checkCache = root->GetBinaryDirectory();
+  std::string checkCache = mf->GetHomeOutputDirectory();
   checkCache += "/";
   checkCache += cmake::GetCMakeFilesDirectoryPostSlash();
   checkCache += "cmake.check_cache";
@@ -602,9 +602,9 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile(
   makefileStream << "\n\t" <<
     this->ConvertToRelativeForMake(cmSystemTools::GetCMakeCommand().c_str())
                  << " -H" << this->ConvertToRelativeForMake(
-                   root->GetSourceDirectory())
+                   mf->GetHomeDirectory())
                  << " -B" << this->ConvertToRelativeForMake(
-                   root->GetBinaryDirectory()) << "\n";
+                   mf->GetHomeOutputDirectory()) << "\n";
 }
 
 //----------------------------------------------------------------------------
@@ -3746,7 +3746,7 @@ cmGlobalXCodeGenerator::OutputXCodeProject(cmLocalGenerator* root,
   // Since this call may have created new cache entries, save the cache:
   //
   root->GetMakefile()->GetCMakeInstance()->SaveCache(
-    root->GetBinaryDirectory());
+    root->GetMakefile()->GetHomeOutputDirectory());
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 6c442f4..b7833cd 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2868,16 +2868,6 @@ cmake* cmLocalGenerator::GetCMakeInstance() const
   return this->GlobalGenerator->GetCMakeInstance();
 }
 
-const char* cmLocalGenerator::GetSourceDirectory() const
-{
-  return this->GetCMakeInstance()->GetHomeDirectory();
-}
-
-const char* cmLocalGenerator::GetBinaryDirectory() const
-{
-  return this->GetCMakeInstance()->GetHomeOutputDirectory();
-}
-
 //----------------------------------------------------------------------------
 std::string
 cmLocalGenerator::GetTargetDirectory(cmTarget const&) const
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 2123f1e..b3bf8cd 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -255,9 +255,6 @@ public:
 
   cmake* GetCMakeInstance() const;
 
-  const char* GetSourceDirectory() const;
-  const char* GetBinaryDirectory() const;
-
   /**
    * Generate a Mac OS X application bundle Info.plist file.
    */
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index bf5afc1..b131a63 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -399,7 +399,7 @@ cmLocalUnixMakefileGenerator3
       );
     }
   this->CreateCDCommand(commands,
-                        this->GetBinaryDirectory(),
+                        this->Makefile->GetHomeOutputDirectory(),
                         cmLocalGenerator::START_OUTPUT);
 
   // Write the rule to the makefile.
@@ -449,7 +449,7 @@ void cmLocalUnixMakefileGenerator3
       commands.push_back(this->GetRecursiveMakeCall
                          (makefile2.c_str(),localName));
       this->CreateCDCommand(commands,
-                            this->GetBinaryDirectory(),
+                            this->Makefile->GetHomeOutputDirectory(),
                             cmLocalGenerator::START_OUTPUT);
       this->WriteMakeRule(ruleFileStream, "Convenience name for target.",
                           localName, depends, commands, true);
@@ -478,7 +478,7 @@ void cmLocalUnixMakefileGenerator3
       commands.push_back(this->GetRecursiveMakeCall
                          (makefileName.c_str(), makeTargetName));
       this->CreateCDCommand(commands,
-                            this->GetBinaryDirectory(),
+                            this->Makefile->GetHomeOutputDirectory(),
                             cmLocalGenerator::START_OUTPUT);
       this->WriteMakeRule(ruleFileStream, "fast build rule for target.",
                           localName, depends, commands, true);
@@ -496,7 +496,7 @@ void cmLocalUnixMakefileGenerator3
         commands.push_back(this->GetRecursiveMakeCall
                            (makefile2.c_str(), makeTargetName));
         this->CreateCDCommand(commands,
-                              this->GetBinaryDirectory(),
+                              this->Makefile->GetHomeOutputDirectory(),
                               cmLocalGenerator::START_OUTPUT);
         this->WriteMakeRule(ruleFileStream,
                             "Manual pre-install relink rule for target.",
@@ -750,13 +750,13 @@ cmLocalUnixMakefileGenerator3
   makefileStream
     << "# The top-level source directory on which CMake was run.\n"
     << "CMAKE_SOURCE_DIR = "
-    << this->Convert(this->GetSourceDirectory(), FULL, SHELL)
+    << this->Convert(this->Makefile->GetHomeDirectory(), FULL, SHELL)
     << "\n"
     << "\n";
   makefileStream
     << "# The top-level build directory on which CMake was run.\n"
     << "CMAKE_BINARY_DIR = "
-    << this->Convert(this->GetBinaryDirectory(), FULL, SHELL)
+    << this->Convert(this->Makefile->GetHomeOutputDirectory(), FULL, SHELL)
     << "\n"
     << "\n";
 }
@@ -889,7 +889,7 @@ void cmLocalUnixMakefileGenerator3
   if(!this->GetMakefile()->IsRootMakefile())
     {
     this->CreateCDCommand(commands,
-                          this->GetBinaryDirectory(),
+                          this->Makefile->GetHomeOutputDirectory(),
                           cmLocalGenerator::START_OUTPUT);
     }
   this->WriteMakeRule(makefileStream,
@@ -1838,7 +1838,7 @@ void cmLocalUnixMakefileGenerator3
 
   depends.push_back("cmake_check_build_system");
 
-  std::string progressDir = this->GetBinaryDirectory();
+  std::string progressDir = this->Makefile->GetHomeOutputDirectory();
   progressDir += cmake::GetCMakeFilesDirectory();
     {
     std::ostringstream progCmd;
@@ -1862,7 +1862,7 @@ void cmLocalUnixMakefileGenerator3
   commands.push_back(this->GetRecursiveMakeCall(mf2Dir.c_str(),
                                                 recursiveTarget));
   this->CreateCDCommand(commands,
-                        this->GetBinaryDirectory(),
+                        this->Makefile->GetHomeOutputDirectory(),
                         cmLocalGenerator::START_OUTPUT);
     {
     std::ostringstream progCmd;
@@ -1884,7 +1884,7 @@ void cmLocalUnixMakefileGenerator3
   commands.push_back(this->GetRecursiveMakeCall(mf2Dir.c_str(),
                                                 recursiveTarget));
   this->CreateCDCommand(commands,
-                                this->GetBinaryDirectory(),
+                                this->Makefile->GetHomeOutputDirectory(),
                                 cmLocalGenerator::START_OUTPUT);
   this->WriteMakeRule(ruleFileStream, "The main clean target", "clean",
                       depends, commands, true);
@@ -1914,7 +1914,7 @@ void cmLocalUnixMakefileGenerator3
   commands.push_back
     (this->GetRecursiveMakeCall(mf2Dir.c_str(), recursiveTarget));
   this->CreateCDCommand(commands,
-                        this->GetBinaryDirectory(),
+                        this->Makefile->GetHomeOutputDirectory(),
                         cmLocalGenerator::START_OUTPUT);
   this->WriteMakeRule(ruleFileStream, "Prepare targets for installation.",
                       "preinstall", depends, commands, true);
@@ -1935,7 +1935,7 @@ void cmLocalUnixMakefileGenerator3
   runRule += " 1";
   commands.push_back(runRule);
   this->CreateCDCommand(commands,
-                        this->GetBinaryDirectory(),
+                        this->Makefile->GetHomeOutputDirectory(),
                         cmLocalGenerator::START_OUTPUT);
   this->WriteMakeRule(ruleFileStream, "clear depends",
                       "depend",
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 66b3dd3..cc94cd4 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -112,7 +112,7 @@ void cmLocalVisualStudio6Generator::OutputDSPFile()
 {
   // If not an in source build, then create the output directory
   if(strcmp(this->Makefile->GetCurrentBinaryDirectory(),
-            this->GetSourceDirectory()) != 0)
+            this->Makefile->GetHomeDirectory()) != 0)
     {
     if(!cmSystemTools::MakeDirectory
        (this->Makefile->GetCurrentBinaryDirectory()))
@@ -226,10 +226,10 @@ void cmLocalVisualStudio6Generator::AddDSPBuildRule(cmTarget& tgt)
   comment += makefileIn;
   std::string args;
   args = "-H";
-  args += this->GetSourceDirectory();
+  args += this->Makefile->GetHomeDirectory();
   commandLine.push_back(args);
   args = "-B";
-  args += this->GetBinaryDirectory();
+  args += this->Makefile->GetHomeOutputDirectory();
   commandLine.push_back(args);
 
   std::vector<std::string> const& listFiles = this->Makefile->GetListFiles();
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 9c25651..a4bce8a 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -161,7 +161,7 @@ void cmLocalVisualStudio7Generator::WriteProjectFiles()
 {
   // If not an in source build, then create the output directory
   if(strcmp(this->Makefile->GetCurrentBinaryDirectory(),
-            this->GetSourceDirectory()) != 0)
+            this->Makefile->GetHomeDirectory()) != 0)
     {
     if(!cmSystemTools::MakeDirectory
        (this->Makefile->GetCurrentBinaryDirectory()))
@@ -290,10 +290,10 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
   comment += makefileIn;
   std::string args;
   args = "-H";
-  args += this->GetSourceDirectory();
+  args += this->Makefile->GetHomeDirectory();
   commandLine.push_back(args);
   args = "-B";
-  args += this->GetBinaryDirectory();
+  args += this->Makefile->GetHomeOutputDirectory();
   commandLine.push_back(args);
   commandLine.push_back("--check-stamp-file");
   std::string stampFilename = this->Convert(stampName.c_str(), FULL,
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 8c700a1..b278087 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1095,7 +1095,7 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
   // translation table for the dependency scanning process.
   depCmd << "cd "
          << (this->LocalGenerator->Convert(
-               this->LocalGenerator->GetBinaryDirectory(),
+               this->Makefile->GetHomeOutputDirectory(),
                cmLocalGenerator::FULL, cmLocalGenerator::SHELL))
          << " && ";
 #endif
@@ -1110,13 +1110,13 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
   // the state of our local generator sufficiently for its needs.
   depCmd << "$(CMAKE_COMMAND) -E cmake_depends \""
          << this->GlobalGenerator->GetName() << "\" "
-         << this->Convert(this->LocalGenerator->GetSourceDirectory(),
+         << this->Convert(this->Makefile->GetHomeDirectory(),
                           cmLocalGenerator::FULL, cmLocalGenerator::SHELL)
          << " "
          << this->Convert(this->Makefile->GetCurrentSourceDirectory(),
                           cmLocalGenerator::FULL, cmLocalGenerator::SHELL)
          << " "
-         << this->Convert(this->LocalGenerator->GetBinaryDirectory(),
+         << this->Convert(this->Makefile->GetHomeOutputDirectory(),
                           cmLocalGenerator::FULL, cmLocalGenerator::SHELL)
          << " "
          << this->Convert(this->Makefile->GetCurrentBinaryDirectory(),
@@ -1242,7 +1242,7 @@ void
 cmMakefileTargetGenerator
 ::MakeEchoProgress(cmLocalUnixMakefileGenerator3::EchoProgress& progress) const
 {
-  progress.Dir = this->LocalGenerator->GetBinaryDirectory();
+  progress.Dir = this->Makefile->GetHomeOutputDirectory();
   progress.Dir += cmake::GetCMakeFilesDirectory();
   std::ostringstream progressArg;
   progressArg << "$(CMAKE_PROGRESS_" << this->NumberOfProgressActions << ")";
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index fb598e8..84c19a3 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -666,8 +666,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
   if (!preLinkCmdLines.empty())
     {
     const std::string homeOutDir = localGen.ConvertToOutputFormat(
-                                            localGen.GetBinaryDirectory(),
-                                            cmLocalGenerator::SHELL);
+                                              mf->GetHomeOutputDirectory(),
+                                              cmLocalGenerator::SHELL);
     preLinkCmdLines.push_back("cd " + homeOutDir);
     }
 
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index d792ba7..6e6dc60 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -47,7 +47,7 @@ cmNinjaTargetGenerator::New(cmGeneratorTarget* target)
         // in every directory, which we don't need.
         cmMakefile *mf = target->Target->GetMakefile();
         if (strcmp(mf->GetCurrentSourceDirectory(),
-                   target->GetLocalGenerator()->GetSourceDirectory()) == 0)
+                   mf->GetHomeDirectory()) == 0)
           return new cmNinjaUtilityTargetGenerator(target);
         // else fallthrough
       }
diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx
index 3e36589..58b901a 100644
--- a/Source/cmNinjaUtilityTargetGenerator.cxx
+++ b/Source/cmNinjaUtilityTargetGenerator.cxx
@@ -103,13 +103,13 @@ void cmNinjaUtilityTargetGenerator::Generate()
       command,
       "$(CMAKE_SOURCE_DIR)",
       this->GetLocalGenerator()->ConvertToOutputFormat(
-        this->GetLocalGenerator()->GetSourceDirectory(),
+        this->GetTarget()->GetMakefile()->GetHomeDirectory(),
         cmLocalGenerator::SHELL).c_str());
     cmSystemTools::ReplaceString(
       command,
       "$(CMAKE_BINARY_DIR)",
       this->GetLocalGenerator()->ConvertToOutputFormat(
-        this->GetLocalGenerator()->GetBinaryDirectory(),
+        this->GetTarget()->GetMakefile()->GetHomeOutputDirectory(),
         cmLocalGenerator::SHELL).c_str());
     cmSystemTools::ReplaceString(command, "$(ARGS)", "");
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bf2a0a5aea5fd218de25f07450a7a69e3f3adcd7
commit bf2a0a5aea5fd218de25f07450a7a69e3f3adcd7
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 7 22:01:00 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Oct 7 22:01:00 2015 +0200

    Revert "cmLocalGenerator: Add current binary directory accessor."
    
    This reverts commit f1de916fda8bb37780f8c7ceb01517400ca718e6.

diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx
index 80f560f..856dcd4 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->GetCurrentBinaryDirectory();
+      this->LocalGenerator->GetMakefile()->GetCurrentBinaryDirectory();
     }
 
   // Actually write dependencies to the streams.
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index cb46f8c..883b287 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -76,7 +76,8 @@ void cmExtraCodeBlocksGenerator::Generate()
 void cmExtraCodeBlocksGenerator::CreateProjectFile(
                                      const std::vector<cmLocalGenerator*>& lgs)
 {
-  std::string outputDir=lgs[0]->GetCurrentBinaryDirectory();
+  const cmMakefile* mf=lgs[0]->GetMakefile();
+  std::string outputDir=mf->GetCurrentBinaryDirectory();
   std::string projectName=lgs[0]->GetProjectName();
 
   std::string filename=outputDir+"/";
@@ -330,7 +331,7 @@ void cmExtraCodeBlocksGenerator
           {
           // Only add the global targets from CMAKE_BINARY_DIR,
           // not from the subdirs
-          if (strcmp((*lg)->GetCurrentBinaryDirectory(),
+          if (strcmp(makefile->GetCurrentBinaryDirectory(),
                      (*lg)->GetBinaryDirectory())==0)
             {
             this->AppendTarget(fout, ti->first, 0,
@@ -521,10 +522,11 @@ 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 = lg->GetCurrentBinaryDirectory();
+  std::string filename = mf->GetCurrentBinaryDirectory();
   filename += "/";
   filename += lg->GetTargetDirectory(*target);
   filename += "/";
@@ -551,14 +553,14 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
                                               const char* compiler)
 {
   cmMakefile const* makefile = lg->GetMakefile();
-  std::string makefileName = lg->GetCurrentBinaryDirectory();
+  std::string makefileName = makefile->GetCurrentBinaryDirectory();
   makefileName += "/Makefile";
 
   fout<<"      <Target title=\"" << targetName << "\">\n";
   if (target!=0)
     {
     int cbTargetType = this->GetCBTargetType(target);
-    std::string workingDir = lg->GetCurrentBinaryDirectory();
+    std::string workingDir = makefile->GetCurrentBinaryDirectory();
     if ( target->GetType()==cmTarget::EXECUTABLE)
       {
       // Determine the directory where the executable target is created, and
@@ -655,7 +657,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
   else // e.g. all and the GLOBAL and UTILITY targets
     {
     fout<<"         <Option working_dir=\""
-        << lg->GetCurrentBinaryDirectory() << "\" />\n"
+        << makefile->GetCurrentBinaryDirectory() << "\" />\n"
         <<"         <Option type=\"" << 4 << "\" />\n";
     }
 
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index b4b5c89..763673e 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -68,15 +68,15 @@ void cmExtraCodeLiteGenerator::Generate()
     const cmMakefile* mf =it->second[0]->GetMakefile();
     this->ConfigName = GetConfigurationName( mf );
 
-    if (strcmp(it->second[0]->GetCurrentBinaryDirectory(),
+    if (strcmp(mf->GetCurrentBinaryDirectory(),
                it->second[0]->GetBinaryDirectory()) == 0)
       {
-      workspaceOutputDir   = it->second[0]->GetCurrentBinaryDirectory();
+      workspaceOutputDir   = mf->GetCurrentBinaryDirectory();
       workspaceProjectName = it->second[0]->GetProjectName();
       workspaceSourcePath  = it->second[0]->GetSourceDirectory();
       workspaceFileName    = workspaceOutputDir+"/";
       workspaceFileName   += workspaceProjectName + ".workspace";
-      this->WorkspacePath = it->second[0]->GetCurrentBinaryDirectory();;
+      this->WorkspacePath = mf->GetCurrentBinaryDirectory();;
 
       fout.Open(workspaceFileName.c_str(), false, false);
       fout << "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
@@ -91,7 +91,8 @@ void cmExtraCodeLiteGenerator::Generate()
        ++it)
     {
     // retrive project information
-    std::string outputDir   = it->second[0]->GetCurrentBinaryDirectory();
+    const cmMakefile* mf    = it->second[0]->GetMakefile();
+    std::string outputDir   = mf->GetCurrentBinaryDirectory();
     std::string projectName = it->second[0]->GetProjectName();
     std::string filename    = outputDir + "/" + projectName + ".project";
 
@@ -120,7 +121,8 @@ void cmExtraCodeLiteGenerator::Generate()
 void cmExtraCodeLiteGenerator::CreateProjectFile(
   const std::vector<cmLocalGenerator*>& lgs)
 {
-  std::string outputDir   = lgs[0]->GetCurrentBinaryDirectory();
+  const cmMakefile* mf    = lgs[0]->GetMakefile();
+  std::string outputDir   = mf->GetCurrentBinaryDirectory();
   std::string projectName = lgs[0]->GetProjectName();
   std::string filename    = outputDir + "/";
 
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 8687dad..214e89f 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -208,7 +208,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout,
 
   std::string cacheEntryName = "CMAKE_ECLIPSE_ENVVAR_";
   cacheEntryName += envVar;
-  const char* cacheValue = lg->GetState()->GetInitializedCacheValue(
+  const char* cacheValue = mf->GetState()->GetInitializedCacheValue(
                                                        cacheEntryName);
 
   // now we have both, decide which one to use
@@ -1034,7 +1034,8 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
        ++it)
     {
     const cmTargets& targets = (*it)->GetMakefile()->GetTargets();
-    std::string subdir = (*it)->Convert((*it)->GetCurrentBinaryDirectory(),
+    cmMakefile* makefile=(*it)->GetMakefile();
+    std::string subdir = (*it)->Convert(makefile->GetCurrentBinaryDirectory(),
                            cmLocalGenerator::HOME_OUTPUT);
     if (subdir == ".")
       {
@@ -1095,7 +1096,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
                              ti->first.c_str());
 
           std::string cleanArgs = "-E chdir \"";
-          cleanArgs += (*it)->GetCurrentBinaryDirectory();
+          cleanArgs += makefile->GetCurrentBinaryDirectory();
           cleanArgs += "\" \"";
           cleanArgs += cmSystemTools::GetCMakeCommand();
           cleanArgs += "\" -P \"";
diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx
index 0c009c3..f14a1cc 100644
--- a/Source/cmExtraKateGenerator.cxx
+++ b/Source/cmExtraKateGenerator.cxx
@@ -47,7 +47,7 @@ cmExtraKateGenerator::cmExtraKateGenerator()
 void cmExtraKateGenerator::Generate()
 {
   cmLocalGenerator* lg = this->GlobalGenerator->GetLocalGenerators()[0];
-  cmMakefile* mf = lg->GetMakefile();
+  const cmMakefile* mf = lg->GetMakefile();
   this->ProjectName = this->GenerateProjectName(lg->GetProjectName(),
                           mf->GetSafeDefinition("CMAKE_BUILD_TYPE"),
                           this->GetPathBasename(lg->GetBinaryDirectory()));
@@ -121,7 +121,7 @@ cmExtraKateGenerator::WriteTargets(const cmLocalGenerator* lg,
     {
     const cmTargets& targets = (*it)->GetMakefile()->GetTargets();
     cmMakefile* makefile=(*it)->GetMakefile();
-    std::string currentDir = (*it)->GetCurrentBinaryDirectory();
+    std::string currentDir = makefile->GetCurrentBinaryDirectory();
     bool topLevel = (currentDir == (*it)->GetBinaryDirectory());
 
     for(cmTargets::const_iterator ti=targets.begin(); ti!=targets.end(); ++ti)
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index 133626e..21587d6 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -77,7 +77,8 @@ void cmExtraSublimeTextGenerator::Generate()
 void cmExtraSublimeTextGenerator::CreateProjectFile(
                                      const std::vector<cmLocalGenerator*>& lgs)
 {
-  std::string outputDir=lgs[0]->GetCurrentBinaryDirectory();
+  const cmMakefile* mf=lgs[0]->GetMakefile();
+  std::string outputDir=mf->GetCurrentBinaryDirectory();
   std::string projectName=lgs[0]->GetProjectName();
 
   const std::string filename =
diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx
index ab24f94..f82fcb3 100644
--- a/Source/cmGlobalKdevelopGenerator.cxx
+++ b/Source/cmGlobalKdevelopGenerator.cxx
@@ -49,7 +49,8 @@ void cmGlobalKdevelopGenerator::Generate()
       it!= this->GlobalGenerator->GetProjectMap().end();
       ++it)
     {
-    std::string outputDir=it->second[0]->GetCurrentBinaryDirectory();
+    cmMakefile* mf = it->second[0]->GetMakefile();
+    std::string outputDir=mf->GetCurrentBinaryDirectory();
     std::string projectDir=it->second[0]->GetSourceDirectory();
     std::string projectName=it->second[0]->GetProjectName();
     std::string cmakeFilePattern("CMakeLists.txt;*.cmake;");
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 3dd9e37..2fdc18f 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -163,7 +163,7 @@ void cmGlobalUnixMakefileGenerator3::Generate()
     {
     cmLocalUnixMakefileGenerator3 *lg =
       static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[i]);
-    std::string markFileName = lg->GetCurrentBinaryDirectory();
+    std::string markFileName = lg->GetMakefile()->GetCurrentBinaryDirectory();
     markFileName += "/";
     markFileName += cmake::GetCMakeFilesDirectory();
     markFileName += "/progress.marks";
@@ -395,7 +395,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
     {
     lg =
       static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[i]);
-    tmpStr = lg->GetCurrentBinaryDirectory();
+    tmpStr = lg->GetMakefile()->GetCurrentBinaryDirectory();
     tmpStr += cmake::GetCMakeFilesDirectory();
     tmpStr += "/CMakeDirectoryInformation.cmake";
     cmakefileStream << "  \"" <<
@@ -454,7 +454,7 @@ cmGlobalUnixMakefileGenerator3
                       bool check_relink)
 {
   // Get the relative path to the subdirectory from the top.
-  std::string makeTarget = lg->GetCurrentBinaryDirectory();
+  std::string makeTarget = lg->GetMakefile()->GetCurrentBinaryDirectory();
   makeTarget += "/";
   makeTarget += pass;
 
@@ -534,7 +534,7 @@ cmGlobalUnixMakefileGenerator3
     }
 
   // Begin the directory-level rules section.
-  std::string dir = lg->GetCurrentBinaryDirectory();
+  std::string dir = lg->GetMakefile()->GetCurrentBinaryDirectory();
   dir = lg->Convert(dir, cmLocalGenerator::HOME_OUTPUT,
                     cmLocalGenerator::MAKERULE);
   lg->WriteDivider(ruleFileStream);
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 1ca3bd7..73a952b 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -363,7 +363,7 @@ void cmGlobalVisualStudio7Generator
     return;
     }
   this->CurrentProject = root->GetProjectName();
-  std::string fname = root->GetCurrentBinaryDirectory();
+  std::string fname = root->GetMakefile()->GetCurrentBinaryDirectory();
   fname += "/";
   fname += root->GetProjectName();
   fname += ".sln";
@@ -468,7 +468,8 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
         target->GetProperty("GENERATOR_FILE_NAME");
       if(vcprojName)
         {
-        std::string dir = root->GetCurrentBinaryDirectory();
+        cmMakefile* tmf = target->GetMakefile();
+        std::string dir = tmf->GetCurrentBinaryDirectory();
         dir = root->Convert(dir.c_str(),
                             cmLocalGenerator::START_OUTPUT);
         if(dir == ".")
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index af32563..b40d5b7 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -414,11 +414,11 @@ void cmGlobalXCodeGenerator::SetGenerationRoot(cmLocalGenerator* root)
   this->SetCurrentLocalGenerator(root);
   cmSystemTools::SplitPath(this->CurrentMakefile->GetCurrentSourceDirectory(),
                            this->ProjectSourceDirectoryComponents);
-  cmSystemTools::SplitPath(this->LocalGenerators->GetCurrentBinaryDirectory(),
+  cmSystemTools::SplitPath(this->CurrentMakefile->GetCurrentBinaryDirectory(),
                            this->ProjectOutputDirectoryComponents);
 
   this->CurrentXCodeHackMakefile =
-    root->GetCurrentBinaryDirectory();
+    root->GetMakefile()->GetCurrentBinaryDirectory();
   this->CurrentXCodeHackMakefile += "/CMakeScripts";
   cmSystemTools::MakeDirectory(this->CurrentXCodeHackMakefile.c_str());
   this->CurrentXCodeHackMakefile += "/XCODE_DEPEND_HELPER.make";
@@ -466,7 +466,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
   allbuild->AddSourceCMP0049(listfile.c_str());
 
   // Add XCODE depend helper
-  std::string dir = root->GetCurrentBinaryDirectory();
+  std::string dir = mf->GetCurrentBinaryDirectory();
   cmCustomCommandLine makeHelper;
   if(this->XcodeVersion < 50)
     {
@@ -580,7 +580,7 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile(
   std::vector<std::string>::iterator new_end =
     std::unique(lfiles.begin(), lfiles.end());
   lfiles.erase(new_end, lfiles.end());
-  this->CurrentReRunCMakeMakefile = root->GetCurrentBinaryDirectory();
+  this->CurrentReRunCMakeMakefile = mf->GetCurrentBinaryDirectory();
   this->CurrentReRunCMakeMakefile += "/CMakeScripts";
   cmSystemTools::MakeDirectory(this->CurrentReRunCMakeMakefile.c_str());
   this->CurrentReRunCMakeMakefile += "/ReRunCMake.make";
@@ -1031,7 +1031,7 @@ void cmGlobalXCodeGenerator::SetCurrentLocalGenerator(cmLocalGenerator* gen)
   this->CurrentLocalGenerator = gen;
   this->CurrentMakefile = gen->GetMakefile();
   std::string outdir =
-    cmSystemTools::CollapseFullPath(this->CurrentLocalGenerator->
+    cmSystemTools::CollapseFullPath(this->CurrentMakefile->
                                     GetCurrentBinaryDirectory());
   cmSystemTools::SplitPath(outdir.c_str(),
                            this->CurrentOutputDirectoryComponents);
@@ -1387,7 +1387,7 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmTarget& cmtarget)
   // linker language.  This should convince Xcode to choose the proper
   // language.
   cmMakefile* mf = cmtarget.GetMakefile();
-  std::string fname = gtgt->GetLocalGenerator()->GetCurrentBinaryDirectory();
+  std::string fname = mf->GetCurrentBinaryDirectory();
   fname += cmake::GetCMakeFilesDirectory();
   fname += "/";
   fname += cmtarget.GetName();
@@ -1616,7 +1616,7 @@ cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase,
                                                 const & commands,
                                                 const char* name)
 {
-  std::string dir = this->CurrentLocalGenerator->GetCurrentBinaryDirectory();
+  std::string dir = this->CurrentMakefile->GetCurrentBinaryDirectory();
   dir += "/CMakeScripts";
   cmSystemTools::MakeDirectory(dir.c_str());
   std::string makefile = dir;
@@ -1637,7 +1637,7 @@ cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase,
                                     currentConfig->c_str());
     }
 
-  std::string cdir = this->CurrentLocalGenerator->GetCurrentBinaryDirectory();
+  std::string cdir = this->CurrentMakefile->GetCurrentBinaryDirectory();
   cdir = this->ConvertToRelativeForXCode(cdir.c_str());
   std::string makecmd = "make -C ";
   makecmd += cdir;
@@ -1965,7 +1965,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
     }
 
   // Set attributes to specify the proper name for the target.
-  std::string pndir = this->CurrentLocalGenerator->GetCurrentBinaryDirectory();
+  std::string pndir = this->CurrentMakefile->GetCurrentBinaryDirectory();
   if(target.GetType() == cmTarget::STATIC_LIBRARY ||
      target.GetType() == cmTarget::SHARED_LIBRARY ||
      target.GetType() == cmTarget::MODULE_LIBRARY ||
@@ -3481,7 +3481,7 @@ bool cmGlobalXCodeGenerator
     }
   }
 
-  std::string symroot = root->GetCurrentBinaryDirectory();
+  std::string symroot = root->GetMakefile()->GetCurrentBinaryDirectory();
   symroot += "/build";
   buildSettings->AddAttribute("SYMROOT", this->CreateString(symroot.c_str()));
 
@@ -3724,7 +3724,7 @@ cmGlobalXCodeGenerator::OutputXCodeProject(cmLocalGenerator* root,
     {
     return;
     }
-  std::string xcodeDir = root->GetCurrentBinaryDirectory();
+  std::string xcodeDir = root->GetMakefile()->GetCurrentBinaryDirectory();
   xcodeDir += "/";
   xcodeDir += root->GetProjectName();
   xcodeDir += ".xcode";
diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx
index f7c9cc2..97b9405 100644
--- a/Source/cmInstallExportGenerator.cxx
+++ b/Source/cmInstallExportGenerator.cxx
@@ -64,7 +64,7 @@ void cmInstallExportGenerator::ComputeTempDir()
   // Choose a temporary directory in which to generate the import
   // files to be installed.
   this->TempDir =
-      this->LocalGenerator->GetCurrentBinaryDirectory();
+      this->LocalGenerator->GetMakefile()->GetCurrentBinaryDirectory();
   this->TempDir += cmake::GetCMakeFilesDirectory();
   this->TempDir += "/Export";
   if(this->Destination.empty())
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 8096bd7..6c442f4 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2878,11 +2878,6 @@ const char* cmLocalGenerator::GetBinaryDirectory() const
   return this->GetCMakeInstance()->GetHomeOutputDirectory();
 }
 
-const char* cmLocalGenerator::GetCurrentBinaryDirectory() const
-{
-  return this->StateSnapshot.GetDirectory().GetCurrentBinary();
-}
-
 //----------------------------------------------------------------------------
 std::string
 cmLocalGenerator::GetTargetDirectory(cmTarget const&) const
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 7ca587e..2123f1e 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -258,8 +258,6 @@ public:
   const char* GetSourceDirectory() const;
   const char* GetBinaryDirectory() const;
 
-  const char* GetCurrentBinaryDirectory() const;
-
   /**
    * Generate a Mac OS X application bundle Info.plist file.
    */
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 6319f0e..b1e1d3f 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -363,7 +363,7 @@ void cmLocalNinjaGenerator::AppendCustomCommandLines(
   if (ccg.GetNumberOfCommands() > 0) {
     std::string wd = ccg.GetWorkingDirectory();
     if (wd.empty())
-      wd = this->GetCurrentBinaryDirectory();
+      wd = this->GetMakefile()->GetCurrentBinaryDirectory();
 
     std::ostringstream cdCmd;
 #ifdef _WIN32
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 3a163f0..66b3dd3 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -111,14 +111,14 @@ void cmLocalVisualStudio6Generator::Generate()
 void cmLocalVisualStudio6Generator::OutputDSPFile()
 {
   // If not an in source build, then create the output directory
-  if(strcmp(this->GetCurrentBinaryDirectory(),
+  if(strcmp(this->Makefile->GetCurrentBinaryDirectory(),
             this->GetSourceDirectory()) != 0)
     {
     if(!cmSystemTools::MakeDirectory
-       (this->GetCurrentBinaryDirectory()))
+       (this->Makefile->GetCurrentBinaryDirectory()))
       {
       cmSystemTools::Error("Error creating directory ",
-                           this->GetCurrentBinaryDirectory());
+                           this->Makefile->GetCurrentBinaryDirectory());
       }
     }
 
@@ -163,7 +163,7 @@ void cmLocalVisualStudio6Generator::OutputDSPFile()
       std::string::size_type pos = l->first.rfind('/');
       if(pos != std::string::npos)
         {
-        std::string dir = this->GetCurrentBinaryDirectory();
+        std::string dir = this->Makefile->GetCurrentBinaryDirectory();
         dir += "/";
         dir += l->first.substr(0, pos);
         if(!cmSystemTools::MakeDirectory(dir.c_str()))
@@ -189,7 +189,7 @@ void cmLocalVisualStudio6Generator::CreateSingleDSP(const std::string& lname,
 
   // create the dsp.cmake file
   std::string fname;
-  fname = this->GetCurrentBinaryDirectory();
+  fname = this->Makefile->GetCurrentBinaryDirectory();
   fname += "/";
   fname += pname;
   fname += ".dsp";
@@ -577,9 +577,9 @@ cmLocalVisualStudio6Generator
                         const cmCustomCommand& origCommand)
 {
   // Create a fake output that forces the rule to run.
-  char* output = new char[(strlen(this->GetCurrentBinaryDirectory())
+  char* output = new char[(strlen(this->Makefile->GetCurrentBinaryDirectory())
                            + target.GetName().size() + 30)];
-  sprintf(output,"%s/%s_force_%i", this->GetCurrentBinaryDirectory(),
+  sprintf(output,"%s/%s_force_%i", this->Makefile->GetCurrentBinaryDirectory(),
           target.GetName().c_str(), count);
   const char* comment = origCommand.GetComment();
   if(!comment && origCommand.GetOutputs().empty())
@@ -1962,7 +1962,7 @@ cmLocalVisualStudio6Generator
   // files directory for any configuration.  This is used to construct
   // object file names that do not produce paths that are too long.
   std::string dir_max;
-  dir_max += this->GetCurrentBinaryDirectory();
+  dir_max += this->Makefile->GetCurrentBinaryDirectory();
   dir_max += "/";
   dir_max += config_max;
   dir_max += "/";
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 5a68ab3..9c25651 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -138,7 +138,7 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets()
       cmCustomCommandLines force_commands;
       force_commands.push_back(force_command);
       std::string no_main_dependency = "";
-      std::string force = this->GetCurrentBinaryDirectory();
+      std::string force = this->Makefile->GetCurrentBinaryDirectory();
       force += cmake::GetCMakeFilesDirectory();
       force += "/";
       force += tgt.GetName();
@@ -160,14 +160,14 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets()
 void cmLocalVisualStudio7Generator::WriteProjectFiles()
 {
   // If not an in source build, then create the output directory
-  if(strcmp(this->GetCurrentBinaryDirectory(),
+  if(strcmp(this->Makefile->GetCurrentBinaryDirectory(),
             this->GetSourceDirectory()) != 0)
     {
     if(!cmSystemTools::MakeDirectory
-       (this->GetCurrentBinaryDirectory()))
+       (this->Makefile->GetCurrentBinaryDirectory()))
       {
       cmSystemTools::Error("Error creating directory ",
-                           this->GetCurrentBinaryDirectory());
+                           this->Makefile->GetCurrentBinaryDirectory());
       }
     }
 
@@ -196,7 +196,7 @@ void cmLocalVisualStudio7Generator::WriteStampFiles()
 {
   // Touch a timestamp file used to determine when the project file is
   // out of date.
-  std::string stampName = this->GetCurrentBinaryDirectory();
+  std::string stampName = this->Makefile->GetCurrentBinaryDirectory();
   stampName += cmake::GetCMakeFilesDirectory();
   cmSystemTools::MakeDirectory(stampName.c_str());
   stampName += "/";
@@ -243,7 +243,7 @@ void cmLocalVisualStudio7Generator
   target.SetProperty("GENERATOR_FILE_NAME",lname.c_str());
   // create the dsp.cmake file
   std::string fname;
-  fname = this->GetCurrentBinaryDirectory();
+  fname = this->Makefile->GetCurrentBinaryDirectory();
   fname += "/";
   fname += lname;
   if(this->FortranProject)
@@ -272,7 +272,7 @@ void cmLocalVisualStudio7Generator
 //----------------------------------------------------------------------------
 cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
 {
-  std::string stampName = this->GetCurrentBinaryDirectory();
+  std::string stampName = this->Makefile->GetCurrentBinaryDirectory();
   stampName += "/";
   stampName += cmake::GetCMakeFilesDirectoryPostSlash();
   stampName += "generate.stamp";
@@ -1719,7 +1719,7 @@ cmLocalVisualStudio7Generator
   // files directory for any configuration.  This is used to construct
   // object file names that do not produce paths that are too long.
   std::string dir_max;
-  dir_max += this->GetCurrentBinaryDirectory();
+  dir_max += this->Makefile->GetCurrentBinaryDirectory();
   dir_max += "/";
   dir_max += this->GetTargetDirectory(target);
   dir_max += "/";
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 0b89d1d..8c700a1 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -419,7 +419,7 @@ void cmMakefileTargetGenerator
   this->WriteObjectBuildFile(obj, lang, source, depends);
 
   // The object file should be checked for dependency integrity.
-  std::string objFullPath = this->LocalGenerator->GetCurrentBinaryDirectory();
+  std::string objFullPath = this->Makefile->GetCurrentBinaryDirectory();
   objFullPath += "/";
   objFullPath += obj;
   objFullPath =
@@ -642,7 +642,7 @@ cmMakefileTargetGenerator
     this->LocalGenerator->ExpandRuleVariables(compileCommand, vars);
     std::string workingDirectory =
       this->LocalGenerator->Convert(
-        this->LocalGenerator->GetCurrentBinaryDirectory(), cmLocalGenerator::FULL);
+        this->Makefile->GetCurrentBinaryDirectory(), cmLocalGenerator::FULL);
     compileCommand.replace(compileCommand.find(langFlags),
                            langFlags.size(), this->GetFlags(lang));
     std::string langDefines = std::string("$(") + lang + "_DEFINES)";
@@ -698,7 +698,7 @@ cmMakefileTargetGenerator
   // Change the command working directory to the local build tree.
   this->LocalGenerator->CreateCDCommand
     (compileCommands,
-     this->LocalGenerator->GetCurrentBinaryDirectory(),
+     this->Makefile->GetCurrentBinaryDirectory(),
      cmLocalGenerator::HOME_OUTPUT);
   commands.insert(commands.end(),
                   compileCommands.begin(), compileCommands.end());
@@ -771,7 +771,7 @@ cmMakefileTargetGenerator
 
         this->LocalGenerator->CreateCDCommand
           (preprocessCommands,
-           this->LocalGenerator->GetCurrentBinaryDirectory(),
+           this->Makefile->GetCurrentBinaryDirectory(),
            cmLocalGenerator::HOME_OUTPUT);
         commands.insert(commands.end(),
                         preprocessCommands.begin(),
@@ -828,7 +828,7 @@ cmMakefileTargetGenerator
 
         this->LocalGenerator->CreateCDCommand
           (assemblyCommands,
-           this->LocalGenerator->GetCurrentBinaryDirectory(),
+           this->Makefile->GetCurrentBinaryDirectory(),
            cmLocalGenerator::HOME_OUTPUT);
         commands.insert(commands.end(),
                         assemblyCommands.begin(),
@@ -929,7 +929,7 @@ void cmMakefileTargetGenerator::WriteTargetCleanRules()
                                            *this->Target);
   this->LocalGenerator->CreateCDCommand
     (commands,
-     this->LocalGenerator->GetCurrentBinaryDirectory(),
+     this->Makefile->GetCurrentBinaryDirectory(),
      cmLocalGenerator::HOME_OUTPUT);
 
   // Write the rule.
@@ -1119,7 +1119,7 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
          << this->Convert(this->LocalGenerator->GetBinaryDirectory(),
                           cmLocalGenerator::FULL, cmLocalGenerator::SHELL)
          << " "
-         << this->Convert(this->LocalGenerator->GetCurrentBinaryDirectory(),
+         << this->Convert(this->Makefile->GetCurrentBinaryDirectory(),
                           cmLocalGenerator::FULL, cmLocalGenerator::SHELL)
          << " "
          << this->Convert(this->InfoFileNameFull,
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 8cefd7c..2395ce7 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -195,7 +195,7 @@ cmVisualStudio10TargetGenerator(cmTarget* target,
   this->BuildFileStream = 0;
   this->IsMissingFiles = false;
   this->DefaultArtifactDir =
-    this->LocalGenerator->GetCurrentBinaryDirectory() + std::string("/") +
+    this->Makefile->GetCurrentBinaryDirectory() + std::string("/") +
     this->LocalGenerator->GetTargetDirectory(*this->Target);
 }
 
@@ -297,7 +297,8 @@ void cmVisualStudio10TargetGenerator::Generate()
       return;
       }
     }
-  std::string path =  this->LocalGenerator->GetCurrentBinaryDirectory();
+  cmMakefile* mf = this->Target->GetMakefile();
+  std::string path =  mf->GetCurrentBinaryDirectory();
   path += "/";
   path += this->Name;
   path += ".vcxproj";
@@ -950,7 +951,7 @@ cmVisualStudio10TargetGenerator::ConvertPath(std::string const& path,
 {
   return forceRelative
     ? cmSystemTools::RelativePath(
-      this->LocalGenerator->GetCurrentBinaryDirectory(), path.c_str())
+      this->Makefile->GetCurrentBinaryDirectory(), path.c_str())
     : path.c_str();
 }
 
@@ -989,7 +990,7 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
   this->AddMissingSourceGroups(groupsUsed, sourceGroups);
 
   // Write out group file
-  std::string path =  this->LocalGenerator->GetCurrentBinaryDirectory();
+  std::string path =  this->Makefile->GetCurrentBinaryDirectory();
   path += "/";
   path += this->Name;
   path += ".vcxproj.filters";
@@ -1447,7 +1448,7 @@ void cmVisualStudio10TargetGenerator::WriteSource(
     std::string sourceRel = this->ConvertPath(sf->GetFullPath(), true);
     size_t const maxLen = 250;
     if(sf->GetCustomCommand() ||
-       ((strlen(this->LocalGenerator->GetCurrentBinaryDirectory()) + 1 +
+       ((strlen(this->Makefile->GetCurrentBinaryDirectory()) + 1 +
          sourceRel.length()) <= maxLen))
       {
       forceRelative = true;
@@ -3312,8 +3313,7 @@ void cmVisualStudio10TargetGenerator::WriteMissingFilesWP80()
   // For WP80, the manifest needs to be in the same folder as the project
   // this can cause an overwrite problem if projects aren't organized in
   // folders
-  std::string manifestFile =
-      this->LocalGenerator->GetCurrentBinaryDirectory() +
+  std::string manifestFile = this->Makefile->GetCurrentBinaryDirectory() +
                              std::string("/WMAppManifest.xml");
   std::string artifactDir =
     this->LocalGenerator->GetTargetDirectory(*this->Target);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eb68b0e5da527904d72b81e693624e7d9c697dd5
commit eb68b0e5da527904d72b81e693624e7d9c697dd5
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 7 22:00:49 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Oct 7 22:00:49 2015 +0200

    Revert "cmLocalGenerator: Add current source directory accessor."
    
    This reverts commit 8029773fbd01c8dafe1a6f7e0136ae9b7a5339e1.

diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index efd5b58..8687dad 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -497,7 +497,7 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
 
     std::string sourceLinkedResourceName = "[Source directory]";
     std::string linkSourceDirectory = this->GetEclipsePath(
-                                             lg->GetCurrentSourceDirectory());
+                                             mf->GetCurrentSourceDirectory());
     // .project dir can't be subdir of a linked resource dir
     if (!cmSystemTools::IsSubDirectory(this->HomeOutputDirectory,
                                          linkSourceDirectory))
@@ -636,7 +636,7 @@ void cmExtraEclipseCDT4Generator::CreateLinksToSubprojects(
        ++it)
     {
     std::string linkSourceDirectory = this->GetEclipsePath(
-                   it->second[0]->GetCurrentSourceDirectory());
+                   it->second[0]->GetMakefile()->GetCurrentSourceDirectory());
     // a linked resource must not point to a parent directory of .project or
     // .project itself
     if ((baseDir != linkSourceDirectory) &&
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 45250d3..57a8741 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2105,7 +2105,7 @@ cmGlobalGenerator::FindLocalGenerator(const std::string& start_dir) const
   for(std::vector<cmLocalGenerator*>::const_iterator it =
       this->LocalGenerators.begin(); it != this->LocalGenerators.end(); ++it)
     {
-    std::string sd = (*it)->GetCurrentSourceDirectory();
+    std::string sd = (*it)->GetMakefile()->GetCurrentSourceDirectory();
     if (sd == start_dir)
       {
       return *it;
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 201b02c..af32563 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -412,12 +412,10 @@ void cmGlobalXCodeGenerator::SetGenerationRoot(cmLocalGenerator* root)
 {
   this->CurrentProject = root->GetProjectName();
   this->SetCurrentLocalGenerator(root);
-  cmSystemTools::SplitPath(
-        this->CurrentLocalGenerator->GetCurrentSourceDirectory(),
-        this->ProjectSourceDirectoryComponents);
-  cmSystemTools::SplitPath(
-        this->CurrentLocalGenerator->GetCurrentBinaryDirectory(),
-        this->ProjectOutputDirectoryComponents);
+  cmSystemTools::SplitPath(this->CurrentMakefile->GetCurrentSourceDirectory(),
+                           this->ProjectSourceDirectoryComponents);
+  cmSystemTools::SplitPath(this->LocalGenerators->GetCurrentBinaryDirectory(),
+                           this->ProjectOutputDirectoryComponents);
 
   this->CurrentXCodeHackMakefile =
     root->GetCurrentBinaryDirectory();
@@ -462,7 +460,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
   mf->AddGeneratorTarget(allbuild, allBuildGt);
 
   // Refer to the main build configuration file for easy editing.
-  std::string listfile = root->GetCurrentSourceDirectory();
+  std::string listfile = mf->GetCurrentSourceDirectory();
   listfile += "/";
   listfile += "CMakeLists.txt";
   allbuild->AddSourceCMP0049(listfile.c_str());
@@ -556,7 +554,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
         }
 
       // Refer to the build configuration file for easy editing.
-      listfile = lg->GetCurrentSourceDirectory();
+      listfile = lg->GetMakefile()->GetCurrentSourceDirectory();
       listfile += "/";
       listfile += "CMakeLists.txt";
       target.AddSourceCMP0049(listfile.c_str());
@@ -3371,7 +3369,7 @@ bool cmGlobalXCodeGenerator
   // Point Xcode at the top of the source tree.
   {
   std::string pdir =
-    this->RelativeToBinary(root->GetCurrentSourceDirectory());
+    this->RelativeToBinary(root->GetMakefile()->GetCurrentSourceDirectory());
   this->RootObject->AddAttribute("projectDirPath",
                                  this->CreateString(pdir.c_str()));
   this->RootObject->AddAttribute("projectRoot", this->CreateString(""));
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index c0c50c4..8096bd7 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2883,11 +2883,6 @@ const char* cmLocalGenerator::GetCurrentBinaryDirectory() const
   return this->StateSnapshot.GetDirectory().GetCurrentBinary();
 }
 
-const char* cmLocalGenerator::GetCurrentSourceDirectory() const
-{
-  return this->StateSnapshot.GetDirectory().GetCurrentSource();
-}
-
 //----------------------------------------------------------------------------
 std::string
 cmLocalGenerator::GetTargetDirectory(cmTarget const&) const
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 8070667..7ca587e 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -259,7 +259,6 @@ public:
   const char* GetBinaryDirectory() const;
 
   const char* GetCurrentBinaryDirectory() const;
-  const char* GetCurrentSourceDirectory() const;
 
   /**
    * Generate a Mac OS X application bundle Info.plist file.
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index b84cbc5..3a163f0 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -215,7 +215,7 @@ void cmLocalVisualStudio6Generator::AddDSPBuildRule(cmTarget& tgt)
   dspname += ".dsp.cmake";
   cmCustomCommandLine commandLine;
   commandLine.push_back(cmSystemTools::GetCMakeCommand());
-  std::string makefileIn = this->GetCurrentSourceDirectory();
+  std::string makefileIn = this->Makefile->GetCurrentSourceDirectory();
   makefileIn += "/";
   makefileIn += "CMakeLists.txt";
   if(!cmSystemTools::FileExists(makefileIn.c_str()))
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 90c17c6..5a68ab3 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -278,7 +278,7 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
   stampName += "generate.stamp";
   cmCustomCommandLine commandLine;
   commandLine.push_back(cmSystemTools::GetCMakeCommand());
-  std::string makefileIn = this->GetCurrentSourceDirectory();
+  std::string makefileIn = this->Makefile->GetCurrentSourceDirectory();
   makefileIn += "/";
   makefileIn += "CMakeLists.txt";
   makefileIn = cmSystemTools::CollapseFullPath(makefileIn.c_str());
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index b7ca26b..0b89d1d 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1113,7 +1113,7 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
          << this->Convert(this->LocalGenerator->GetSourceDirectory(),
                           cmLocalGenerator::FULL, cmLocalGenerator::SHELL)
          << " "
-         << this->Convert(this->LocalGenerator->GetCurrentSourceDirectory(),
+         << this->Convert(this->Makefile->GetCurrentSourceDirectory(),
                           cmLocalGenerator::FULL, cmLocalGenerator::SHELL)
          << " "
          << this->Convert(this->LocalGenerator->GetBinaryDirectory(),
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 133d2ff..d792ba7 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -45,7 +45,8 @@ cmNinjaTargetGenerator::New(cmGeneratorTarget* target)
         // We only want to process global targets that live in the home
         // (i.e. top-level) directory.  CMake creates copies of these targets
         // in every directory, which we don't need.
-        if (strcmp(target->GetLocalGenerator()->GetCurrentSourceDirectory(),
+        cmMakefile *mf = target->Target->GetMakefile();
+        if (strcmp(mf->GetCurrentSourceDirectory(),
                    target->GetLocalGenerator()->GetSourceDirectory()) == 0)
           return new cmNinjaUtilityTargetGenerator(target);
         // else fallthrough
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 92b7a57..8cefd7c 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2243,7 +2243,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
 {
   // Look through the sources for AndroidManifest.xml and use
   // its location as the root source directory.
-  std::string rootDir = this->LocalGenerator->GetCurrentSourceDirectory();
+  std::string rootDir = this->Makefile->GetCurrentSourceDirectory();
   {
   std::vector<cmSourceFile const*> extraSources;
   this->GeneratorTarget->GetExtraSources(extraSources, "");

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fd6692825f5e4b9787746e2811a8a53e33886138
commit fd6692825f5e4b9787746e2811a8a53e33886138
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 7 19:42:13 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Oct 7 22:00:23 2015 +0200

    Remove some needless GetMakefile() calls.

diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index 7f3b651..4b6bd50 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -101,7 +101,7 @@ cmCustomCommandGenerator
       }
     else
       {
-      cmOutputConverter converter(this->LG->GetMakefile()->GetStateSnapshot());
+      cmOutputConverter converter(this->LG->GetStateSnapshot());
       cmd += converter.EscapeForShell(arg, this->MakeVars);
       }
     }
diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx
index e4d9f10..8ac5cbc 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.cxx
+++ b/Source/cmGeneratorExpressionEvaluationFile.cxx
@@ -139,7 +139,7 @@ void cmGeneratorExpressionEvaluationFile::Generate(cmLocalGenerator *lg)
       {
       std::ostringstream e;
       e << "Evaluation file \"" << this->Input << "\" cannot be read.";
-      lg->GetMakefile()->IssueMessage(cmake::FATAL_ERROR, e.str());
+      lg->IssueMessage(cmake::FATAL_ERROR, e.str());
       return;
       }
 
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 775ad2b..3dd9e37 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -495,7 +495,7 @@ cmGlobalUnixMakefileGenerator3
   // The directory-level rule should depend on the directory-level
   // rules of the subdirectories.
   std::vector<cmState::Snapshot> children
-      = lg->GetMakefile()->GetStateSnapshot().GetChildren();
+      = lg->GetStateSnapshot().GetChildren();
   for(std::vector<cmState::Snapshot>::const_iterator
         ci = children.begin(); ci != children.end(); ++ci)
     {

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8029773fbd01c8dafe1a6f7e0136ae9b7a5339e1
commit 8029773fbd01c8dafe1a6f7e0136ae9b7a5339e1
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 7 19:25:29 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Oct 7 22:00:23 2015 +0200

    cmLocalGenerator: Add current source directory accessor.

diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 8687dad..efd5b58 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -497,7 +497,7 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
 
     std::string sourceLinkedResourceName = "[Source directory]";
     std::string linkSourceDirectory = this->GetEclipsePath(
-                                             mf->GetCurrentSourceDirectory());
+                                             lg->GetCurrentSourceDirectory());
     // .project dir can't be subdir of a linked resource dir
     if (!cmSystemTools::IsSubDirectory(this->HomeOutputDirectory,
                                          linkSourceDirectory))
@@ -636,7 +636,7 @@ void cmExtraEclipseCDT4Generator::CreateLinksToSubprojects(
        ++it)
     {
     std::string linkSourceDirectory = this->GetEclipsePath(
-                   it->second[0]->GetMakefile()->GetCurrentSourceDirectory());
+                   it->second[0]->GetCurrentSourceDirectory());
     // a linked resource must not point to a parent directory of .project or
     // .project itself
     if ((baseDir != linkSourceDirectory) &&
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 57a8741..45250d3 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2105,7 +2105,7 @@ cmGlobalGenerator::FindLocalGenerator(const std::string& start_dir) const
   for(std::vector<cmLocalGenerator*>::const_iterator it =
       this->LocalGenerators.begin(); it != this->LocalGenerators.end(); ++it)
     {
-    std::string sd = (*it)->GetMakefile()->GetCurrentSourceDirectory();
+    std::string sd = (*it)->GetCurrentSourceDirectory();
     if (sd == start_dir)
       {
       return *it;
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index af32563..201b02c 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -412,10 +412,12 @@ void cmGlobalXCodeGenerator::SetGenerationRoot(cmLocalGenerator* root)
 {
   this->CurrentProject = root->GetProjectName();
   this->SetCurrentLocalGenerator(root);
-  cmSystemTools::SplitPath(this->CurrentMakefile->GetCurrentSourceDirectory(),
-                           this->ProjectSourceDirectoryComponents);
-  cmSystemTools::SplitPath(this->LocalGenerators->GetCurrentBinaryDirectory(),
-                           this->ProjectOutputDirectoryComponents);
+  cmSystemTools::SplitPath(
+        this->CurrentLocalGenerator->GetCurrentSourceDirectory(),
+        this->ProjectSourceDirectoryComponents);
+  cmSystemTools::SplitPath(
+        this->CurrentLocalGenerator->GetCurrentBinaryDirectory(),
+        this->ProjectOutputDirectoryComponents);
 
   this->CurrentXCodeHackMakefile =
     root->GetCurrentBinaryDirectory();
@@ -460,7 +462,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
   mf->AddGeneratorTarget(allbuild, allBuildGt);
 
   // Refer to the main build configuration file for easy editing.
-  std::string listfile = mf->GetCurrentSourceDirectory();
+  std::string listfile = root->GetCurrentSourceDirectory();
   listfile += "/";
   listfile += "CMakeLists.txt";
   allbuild->AddSourceCMP0049(listfile.c_str());
@@ -554,7 +556,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
         }
 
       // Refer to the build configuration file for easy editing.
-      listfile = lg->GetMakefile()->GetCurrentSourceDirectory();
+      listfile = lg->GetCurrentSourceDirectory();
       listfile += "/";
       listfile += "CMakeLists.txt";
       target.AddSourceCMP0049(listfile.c_str());
@@ -3369,7 +3371,7 @@ bool cmGlobalXCodeGenerator
   // Point Xcode at the top of the source tree.
   {
   std::string pdir =
-    this->RelativeToBinary(root->GetMakefile()->GetCurrentSourceDirectory());
+    this->RelativeToBinary(root->GetCurrentSourceDirectory());
   this->RootObject->AddAttribute("projectDirPath",
                                  this->CreateString(pdir.c_str()));
   this->RootObject->AddAttribute("projectRoot", this->CreateString(""));
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 8096bd7..c0c50c4 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2883,6 +2883,11 @@ const char* cmLocalGenerator::GetCurrentBinaryDirectory() const
   return this->StateSnapshot.GetDirectory().GetCurrentBinary();
 }
 
+const char* cmLocalGenerator::GetCurrentSourceDirectory() const
+{
+  return this->StateSnapshot.GetDirectory().GetCurrentSource();
+}
+
 //----------------------------------------------------------------------------
 std::string
 cmLocalGenerator::GetTargetDirectory(cmTarget const&) const
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 7ca587e..8070667 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -259,6 +259,7 @@ public:
   const char* GetBinaryDirectory() const;
 
   const char* GetCurrentBinaryDirectory() const;
+  const char* GetCurrentSourceDirectory() const;
 
   /**
    * Generate a Mac OS X application bundle Info.plist file.
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 3a163f0..b84cbc5 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -215,7 +215,7 @@ void cmLocalVisualStudio6Generator::AddDSPBuildRule(cmTarget& tgt)
   dspname += ".dsp.cmake";
   cmCustomCommandLine commandLine;
   commandLine.push_back(cmSystemTools::GetCMakeCommand());
-  std::string makefileIn = this->Makefile->GetCurrentSourceDirectory();
+  std::string makefileIn = this->GetCurrentSourceDirectory();
   makefileIn += "/";
   makefileIn += "CMakeLists.txt";
   if(!cmSystemTools::FileExists(makefileIn.c_str()))
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 5a68ab3..90c17c6 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -278,7 +278,7 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
   stampName += "generate.stamp";
   cmCustomCommandLine commandLine;
   commandLine.push_back(cmSystemTools::GetCMakeCommand());
-  std::string makefileIn = this->Makefile->GetCurrentSourceDirectory();
+  std::string makefileIn = this->GetCurrentSourceDirectory();
   makefileIn += "/";
   makefileIn += "CMakeLists.txt";
   makefileIn = cmSystemTools::CollapseFullPath(makefileIn.c_str());
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 0b89d1d..b7ca26b 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1113,7 +1113,7 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
          << this->Convert(this->LocalGenerator->GetSourceDirectory(),
                           cmLocalGenerator::FULL, cmLocalGenerator::SHELL)
          << " "
-         << this->Convert(this->Makefile->GetCurrentSourceDirectory(),
+         << this->Convert(this->LocalGenerator->GetCurrentSourceDirectory(),
                           cmLocalGenerator::FULL, cmLocalGenerator::SHELL)
          << " "
          << this->Convert(this->LocalGenerator->GetBinaryDirectory(),
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index d792ba7..133d2ff 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -45,8 +45,7 @@ cmNinjaTargetGenerator::New(cmGeneratorTarget* target)
         // We only want to process global targets that live in the home
         // (i.e. top-level) directory.  CMake creates copies of these targets
         // in every directory, which we don't need.
-        cmMakefile *mf = target->Target->GetMakefile();
-        if (strcmp(mf->GetCurrentSourceDirectory(),
+        if (strcmp(target->GetLocalGenerator()->GetCurrentSourceDirectory(),
                    target->GetLocalGenerator()->GetSourceDirectory()) == 0)
           return new cmNinjaUtilityTargetGenerator(target);
         // else fallthrough
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 8cefd7c..92b7a57 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2243,7 +2243,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
 {
   // Look through the sources for AndroidManifest.xml and use
   // its location as the root source directory.
-  std::string rootDir = this->Makefile->GetCurrentSourceDirectory();
+  std::string rootDir = this->LocalGenerator->GetCurrentSourceDirectory();
   {
   std::vector<cmSourceFile const*> extraSources;
   this->GeneratorTarget->GetExtraSources(extraSources, "");

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f1de916fda8bb37780f8c7ceb01517400ca718e6
commit f1de916fda8bb37780f8c7ceb01517400ca718e6
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Sep 25 00:13:20 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Oct 7 21:59:59 2015 +0200

    cmLocalGenerator: Add current binary directory accessor.

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 883b287..cb46f8c 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -76,8 +76,7 @@ void cmExtraCodeBlocksGenerator::Generate()
 void cmExtraCodeBlocksGenerator::CreateProjectFile(
                                      const std::vector<cmLocalGenerator*>& 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,
@@ -522,11 +521,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 += "/";
@@ -553,14 +551,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<<"      <Target title=\"" << targetName << "\">\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
@@ -657,7 +655,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
   else // e.g. all and the GLOBAL and UTILITY targets
     {
     fout<<"         <Option working_dir=\""
-        << makefile->GetCurrentBinaryDirectory() << "\" />\n"
+        << lg->GetCurrentBinaryDirectory() << "\" />\n"
         <<"         <Option type=\"" << 4 << "\" />\n";
     }
 
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index 763673e..b4b5c89 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -68,15 +68,15 @@ void cmExtraCodeLiteGenerator::Generate()
     const cmMakefile* mf =it->second[0]->GetMakefile();
     this->ConfigName = GetConfigurationName( mf );
 
-    if (strcmp(mf->GetCurrentBinaryDirectory(),
+    if (strcmp(it->second[0]->GetCurrentBinaryDirectory(),
                it->second[0]->GetBinaryDirectory()) == 0)
       {
-      workspaceOutputDir   = mf->GetCurrentBinaryDirectory();
+      workspaceOutputDir   = it->second[0]->GetCurrentBinaryDirectory();
       workspaceProjectName = it->second[0]->GetProjectName();
       workspaceSourcePath  = it->second[0]->GetSourceDirectory();
       workspaceFileName    = workspaceOutputDir+"/";
       workspaceFileName   += workspaceProjectName + ".workspace";
-      this->WorkspacePath = mf->GetCurrentBinaryDirectory();;
+      this->WorkspacePath = it->second[0]->GetCurrentBinaryDirectory();;
 
       fout.Open(workspaceFileName.c_str(), false, false);
       fout << "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
@@ -91,8 +91,7 @@ void cmExtraCodeLiteGenerator::Generate()
        ++it)
     {
     // retrive project information
-    const cmMakefile* mf    = it->second[0]->GetMakefile();
-    std::string outputDir   = mf->GetCurrentBinaryDirectory();
+    std::string outputDir   = it->second[0]->GetCurrentBinaryDirectory();
     std::string projectName = it->second[0]->GetProjectName();
     std::string filename    = outputDir + "/" + projectName + ".project";
 
@@ -121,8 +120,7 @@ void cmExtraCodeLiteGenerator::Generate()
 void cmExtraCodeLiteGenerator::CreateProjectFile(
   const std::vector<cmLocalGenerator*>& 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 + "/";
 
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 214e89f..8687dad 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -208,7 +208,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout,
 
   std::string cacheEntryName = "CMAKE_ECLIPSE_ENVVAR_";
   cacheEntryName += envVar;
-  const char* cacheValue = mf->GetState()->GetInitializedCacheValue(
+  const char* cacheValue = lg->GetState()->GetInitializedCacheValue(
                                                        cacheEntryName);
 
   // now we have both, decide which one to use
@@ -1034,8 +1034,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
        ++it)
     {
     const cmTargets& targets = (*it)->GetMakefile()->GetTargets();
-    cmMakefile* makefile=(*it)->GetMakefile();
-    std::string subdir = (*it)->Convert(makefile->GetCurrentBinaryDirectory(),
+    std::string subdir = (*it)->Convert((*it)->GetCurrentBinaryDirectory(),
                            cmLocalGenerator::HOME_OUTPUT);
     if (subdir == ".")
       {
@@ -1096,7 +1095,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
                              ti->first.c_str());
 
           std::string cleanArgs = "-E chdir \"";
-          cleanArgs += makefile->GetCurrentBinaryDirectory();
+          cleanArgs += (*it)->GetCurrentBinaryDirectory();
           cleanArgs += "\" \"";
           cleanArgs += cmSystemTools::GetCMakeCommand();
           cleanArgs += "\" -P \"";
diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx
index f14a1cc..0c009c3 100644
--- a/Source/cmExtraKateGenerator.cxx
+++ b/Source/cmExtraKateGenerator.cxx
@@ -47,7 +47,7 @@ cmExtraKateGenerator::cmExtraKateGenerator()
 void cmExtraKateGenerator::Generate()
 {
   cmLocalGenerator* lg = this->GlobalGenerator->GetLocalGenerators()[0];
-  const cmMakefile* mf = lg->GetMakefile();
+  cmMakefile* mf = lg->GetMakefile();
   this->ProjectName = this->GenerateProjectName(lg->GetProjectName(),
                           mf->GetSafeDefinition("CMAKE_BUILD_TYPE"),
                           this->GetPathBasename(lg->GetBinaryDirectory()));
@@ -121,7 +121,7 @@ cmExtraKateGenerator::WriteTargets(const cmLocalGenerator* lg,
     {
     const cmTargets& targets = (*it)->GetMakefile()->GetTargets();
     cmMakefile* makefile=(*it)->GetMakefile();
-    std::string currentDir = makefile->GetCurrentBinaryDirectory();
+    std::string currentDir = (*it)->GetCurrentBinaryDirectory();
     bool topLevel = (currentDir == (*it)->GetBinaryDirectory());
 
     for(cmTargets::const_iterator ti=targets.begin(); ti!=targets.end(); ++ti)
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index 21587d6..133626e 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -77,8 +77,7 @@ void cmExtraSublimeTextGenerator::Generate()
 void cmExtraSublimeTextGenerator::CreateProjectFile(
                                      const std::vector<cmLocalGenerator*>& lgs)
 {
-  const cmMakefile* mf=lgs[0]->GetMakefile();
-  std::string outputDir=mf->GetCurrentBinaryDirectory();
+  std::string outputDir=lgs[0]->GetCurrentBinaryDirectory();
   std::string projectName=lgs[0]->GetProjectName();
 
   const std::string filename =
diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx
index f82fcb3..ab24f94 100644
--- a/Source/cmGlobalKdevelopGenerator.cxx
+++ b/Source/cmGlobalKdevelopGenerator.cxx
@@ -49,8 +49,7 @@ void cmGlobalKdevelopGenerator::Generate()
       it!= this->GlobalGenerator->GetProjectMap().end();
       ++it)
     {
-    cmMakefile* mf = it->second[0]->GetMakefile();
-    std::string outputDir=mf->GetCurrentBinaryDirectory();
+    std::string outputDir=it->second[0]->GetCurrentBinaryDirectory();
     std::string projectDir=it->second[0]->GetSourceDirectory();
     std::string projectName=it->second[0]->GetProjectName();
     std::string cmakeFilePattern("CMakeLists.txt;*.cmake;");
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 59633d9..775ad2b 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -163,7 +163,7 @@ void cmGlobalUnixMakefileGenerator3::Generate()
     {
     cmLocalUnixMakefileGenerator3 *lg =
       static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[i]);
-    std::string markFileName = lg->GetMakefile()->GetCurrentBinaryDirectory();
+    std::string markFileName = lg->GetCurrentBinaryDirectory();
     markFileName += "/";
     markFileName += cmake::GetCMakeFilesDirectory();
     markFileName += "/progress.marks";
@@ -395,7 +395,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
     {
     lg =
       static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[i]);
-    tmpStr = lg->GetMakefile()->GetCurrentBinaryDirectory();
+    tmpStr = lg->GetCurrentBinaryDirectory();
     tmpStr += cmake::GetCMakeFilesDirectory();
     tmpStr += "/CMakeDirectoryInformation.cmake";
     cmakefileStream << "  \"" <<
@@ -454,7 +454,7 @@ cmGlobalUnixMakefileGenerator3
                       bool check_relink)
 {
   // Get the relative path to the subdirectory from the top.
-  std::string makeTarget = lg->GetMakefile()->GetCurrentBinaryDirectory();
+  std::string makeTarget = lg->GetCurrentBinaryDirectory();
   makeTarget += "/";
   makeTarget += pass;
 
@@ -534,7 +534,7 @@ cmGlobalUnixMakefileGenerator3
     }
 
   // Begin the directory-level rules section.
-  std::string dir = lg->GetMakefile()->GetCurrentBinaryDirectory();
+  std::string dir = lg->GetCurrentBinaryDirectory();
   dir = lg->Convert(dir, cmLocalGenerator::HOME_OUTPUT,
                     cmLocalGenerator::MAKERULE);
   lg->WriteDivider(ruleFileStream);
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 73a952b..1ca3bd7 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -363,7 +363,7 @@ void cmGlobalVisualStudio7Generator
     return;
     }
   this->CurrentProject = root->GetProjectName();
-  std::string fname = root->GetMakefile()->GetCurrentBinaryDirectory();
+  std::string fname = root->GetCurrentBinaryDirectory();
   fname += "/";
   fname += root->GetProjectName();
   fname += ".sln";
@@ -468,8 +468,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
         target->GetProperty("GENERATOR_FILE_NAME");
       if(vcprojName)
         {
-        cmMakefile* tmf = target->GetMakefile();
-        std::string dir = tmf->GetCurrentBinaryDirectory();
+        std::string dir = root->GetCurrentBinaryDirectory();
         dir = root->Convert(dir.c_str(),
                             cmLocalGenerator::START_OUTPUT);
         if(dir == ".")
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index b40d5b7..af32563 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -414,11 +414,11 @@ void cmGlobalXCodeGenerator::SetGenerationRoot(cmLocalGenerator* root)
   this->SetCurrentLocalGenerator(root);
   cmSystemTools::SplitPath(this->CurrentMakefile->GetCurrentSourceDirectory(),
                            this->ProjectSourceDirectoryComponents);
-  cmSystemTools::SplitPath(this->CurrentMakefile->GetCurrentBinaryDirectory(),
+  cmSystemTools::SplitPath(this->LocalGenerators->GetCurrentBinaryDirectory(),
                            this->ProjectOutputDirectoryComponents);
 
   this->CurrentXCodeHackMakefile =
-    root->GetMakefile()->GetCurrentBinaryDirectory();
+    root->GetCurrentBinaryDirectory();
   this->CurrentXCodeHackMakefile += "/CMakeScripts";
   cmSystemTools::MakeDirectory(this->CurrentXCodeHackMakefile.c_str());
   this->CurrentXCodeHackMakefile += "/XCODE_DEPEND_HELPER.make";
@@ -466,7 +466,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
   allbuild->AddSourceCMP0049(listfile.c_str());
 
   // Add XCODE depend helper
-  std::string dir = mf->GetCurrentBinaryDirectory();
+  std::string dir = root->GetCurrentBinaryDirectory();
   cmCustomCommandLine makeHelper;
   if(this->XcodeVersion < 50)
     {
@@ -580,7 +580,7 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile(
   std::vector<std::string>::iterator new_end =
     std::unique(lfiles.begin(), lfiles.end());
   lfiles.erase(new_end, lfiles.end());
-  this->CurrentReRunCMakeMakefile = mf->GetCurrentBinaryDirectory();
+  this->CurrentReRunCMakeMakefile = root->GetCurrentBinaryDirectory();
   this->CurrentReRunCMakeMakefile += "/CMakeScripts";
   cmSystemTools::MakeDirectory(this->CurrentReRunCMakeMakefile.c_str());
   this->CurrentReRunCMakeMakefile += "/ReRunCMake.make";
@@ -1031,7 +1031,7 @@ void cmGlobalXCodeGenerator::SetCurrentLocalGenerator(cmLocalGenerator* gen)
   this->CurrentLocalGenerator = gen;
   this->CurrentMakefile = gen->GetMakefile();
   std::string outdir =
-    cmSystemTools::CollapseFullPath(this->CurrentMakefile->
+    cmSystemTools::CollapseFullPath(this->CurrentLocalGenerator->
                                     GetCurrentBinaryDirectory());
   cmSystemTools::SplitPath(outdir.c_str(),
                            this->CurrentOutputDirectoryComponents);
@@ -1387,7 +1387,7 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmTarget& cmtarget)
   // linker language.  This should convince Xcode to choose the proper
   // language.
   cmMakefile* mf = cmtarget.GetMakefile();
-  std::string fname = mf->GetCurrentBinaryDirectory();
+  std::string fname = gtgt->GetLocalGenerator()->GetCurrentBinaryDirectory();
   fname += cmake::GetCMakeFilesDirectory();
   fname += "/";
   fname += cmtarget.GetName();
@@ -1616,7 +1616,7 @@ cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase,
                                                 const & commands,
                                                 const char* name)
 {
-  std::string dir = this->CurrentMakefile->GetCurrentBinaryDirectory();
+  std::string dir = this->CurrentLocalGenerator->GetCurrentBinaryDirectory();
   dir += "/CMakeScripts";
   cmSystemTools::MakeDirectory(dir.c_str());
   std::string makefile = dir;
@@ -1637,7 +1637,7 @@ cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase,
                                     currentConfig->c_str());
     }
 
-  std::string cdir = this->CurrentMakefile->GetCurrentBinaryDirectory();
+  std::string cdir = this->CurrentLocalGenerator->GetCurrentBinaryDirectory();
   cdir = this->ConvertToRelativeForXCode(cdir.c_str());
   std::string makecmd = "make -C ";
   makecmd += cdir;
@@ -1965,7 +1965,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
     }
 
   // Set attributes to specify the proper name for the target.
-  std::string pndir = this->CurrentMakefile->GetCurrentBinaryDirectory();
+  std::string pndir = this->CurrentLocalGenerator->GetCurrentBinaryDirectory();
   if(target.GetType() == cmTarget::STATIC_LIBRARY ||
      target.GetType() == cmTarget::SHARED_LIBRARY ||
      target.GetType() == cmTarget::MODULE_LIBRARY ||
@@ -3481,7 +3481,7 @@ bool cmGlobalXCodeGenerator
     }
   }
 
-  std::string symroot = root->GetMakefile()->GetCurrentBinaryDirectory();
+  std::string symroot = root->GetCurrentBinaryDirectory();
   symroot += "/build";
   buildSettings->AddAttribute("SYMROOT", this->CreateString(symroot.c_str()));
 
@@ -3724,7 +3724,7 @@ cmGlobalXCodeGenerator::OutputXCodeProject(cmLocalGenerator* root,
     {
     return;
     }
-  std::string xcodeDir = root->GetMakefile()->GetCurrentBinaryDirectory();
+  std::string xcodeDir = root->GetCurrentBinaryDirectory();
   xcodeDir += "/";
   xcodeDir += root->GetProjectName();
   xcodeDir += ".xcode";
diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx
index 97b9405..f7c9cc2 100644
--- a/Source/cmInstallExportGenerator.cxx
+++ b/Source/cmInstallExportGenerator.cxx
@@ -64,7 +64,7 @@ void cmInstallExportGenerator::ComputeTempDir()
   // Choose a temporary directory in which to generate the import
   // files to be installed.
   this->TempDir =
-      this->LocalGenerator->GetMakefile()->GetCurrentBinaryDirectory();
+      this->LocalGenerator->GetCurrentBinaryDirectory();
   this->TempDir += cmake::GetCMakeFilesDirectory();
   this->TempDir += "/Export";
   if(this->Destination.empty())
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 6c442f4..8096bd7 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2878,6 +2878,11 @@ const char* cmLocalGenerator::GetBinaryDirectory() const
   return this->GetCMakeInstance()->GetHomeOutputDirectory();
 }
 
+const char* cmLocalGenerator::GetCurrentBinaryDirectory() const
+{
+  return this->StateSnapshot.GetDirectory().GetCurrentBinary();
+}
+
 //----------------------------------------------------------------------------
 std::string
 cmLocalGenerator::GetTargetDirectory(cmTarget const&) const
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 2123f1e..7ca587e 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -258,6 +258,8 @@ public:
   const char* GetSourceDirectory() const;
   const char* GetBinaryDirectory() const;
 
+  const char* GetCurrentBinaryDirectory() const;
+
   /**
    * Generate a Mac OS X application bundle Info.plist file.
    */
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index b1e1d3f..6319f0e 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -363,7 +363,7 @@ void cmLocalNinjaGenerator::AppendCustomCommandLines(
   if (ccg.GetNumberOfCommands() > 0) {
     std::string wd = ccg.GetWorkingDirectory();
     if (wd.empty())
-      wd = this->GetMakefile()->GetCurrentBinaryDirectory();
+      wd = this->GetCurrentBinaryDirectory();
 
     std::ostringstream cdCmd;
 #ifdef _WIN32
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 66b3dd3..3a163f0 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -111,14 +111,14 @@ void cmLocalVisualStudio6Generator::Generate()
 void cmLocalVisualStudio6Generator::OutputDSPFile()
 {
   // If not an in source build, then create the output directory
-  if(strcmp(this->Makefile->GetCurrentBinaryDirectory(),
+  if(strcmp(this->GetCurrentBinaryDirectory(),
             this->GetSourceDirectory()) != 0)
     {
     if(!cmSystemTools::MakeDirectory
-       (this->Makefile->GetCurrentBinaryDirectory()))
+       (this->GetCurrentBinaryDirectory()))
       {
       cmSystemTools::Error("Error creating directory ",
-                           this->Makefile->GetCurrentBinaryDirectory());
+                           this->GetCurrentBinaryDirectory());
       }
     }
 
@@ -163,7 +163,7 @@ void cmLocalVisualStudio6Generator::OutputDSPFile()
       std::string::size_type pos = l->first.rfind('/');
       if(pos != std::string::npos)
         {
-        std::string dir = this->Makefile->GetCurrentBinaryDirectory();
+        std::string dir = this->GetCurrentBinaryDirectory();
         dir += "/";
         dir += l->first.substr(0, pos);
         if(!cmSystemTools::MakeDirectory(dir.c_str()))
@@ -189,7 +189,7 @@ void cmLocalVisualStudio6Generator::CreateSingleDSP(const std::string& lname,
 
   // create the dsp.cmake file
   std::string fname;
-  fname = this->Makefile->GetCurrentBinaryDirectory();
+  fname = this->GetCurrentBinaryDirectory();
   fname += "/";
   fname += pname;
   fname += ".dsp";
@@ -577,9 +577,9 @@ cmLocalVisualStudio6Generator
                         const cmCustomCommand& origCommand)
 {
   // Create a fake output that forces the rule to run.
-  char* output = new char[(strlen(this->Makefile->GetCurrentBinaryDirectory())
+  char* output = new char[(strlen(this->GetCurrentBinaryDirectory())
                            + target.GetName().size() + 30)];
-  sprintf(output,"%s/%s_force_%i", this->Makefile->GetCurrentBinaryDirectory(),
+  sprintf(output,"%s/%s_force_%i", this->GetCurrentBinaryDirectory(),
           target.GetName().c_str(), count);
   const char* comment = origCommand.GetComment();
   if(!comment && origCommand.GetOutputs().empty())
@@ -1962,7 +1962,7 @@ cmLocalVisualStudio6Generator
   // files directory for any configuration.  This is used to construct
   // object file names that do not produce paths that are too long.
   std::string dir_max;
-  dir_max += this->Makefile->GetCurrentBinaryDirectory();
+  dir_max += this->GetCurrentBinaryDirectory();
   dir_max += "/";
   dir_max += config_max;
   dir_max += "/";
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 9c25651..5a68ab3 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -138,7 +138,7 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets()
       cmCustomCommandLines force_commands;
       force_commands.push_back(force_command);
       std::string no_main_dependency = "";
-      std::string force = this->Makefile->GetCurrentBinaryDirectory();
+      std::string force = this->GetCurrentBinaryDirectory();
       force += cmake::GetCMakeFilesDirectory();
       force += "/";
       force += tgt.GetName();
@@ -160,14 +160,14 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets()
 void cmLocalVisualStudio7Generator::WriteProjectFiles()
 {
   // If not an in source build, then create the output directory
-  if(strcmp(this->Makefile->GetCurrentBinaryDirectory(),
+  if(strcmp(this->GetCurrentBinaryDirectory(),
             this->GetSourceDirectory()) != 0)
     {
     if(!cmSystemTools::MakeDirectory
-       (this->Makefile->GetCurrentBinaryDirectory()))
+       (this->GetCurrentBinaryDirectory()))
       {
       cmSystemTools::Error("Error creating directory ",
-                           this->Makefile->GetCurrentBinaryDirectory());
+                           this->GetCurrentBinaryDirectory());
       }
     }
 
@@ -196,7 +196,7 @@ void cmLocalVisualStudio7Generator::WriteStampFiles()
 {
   // Touch a timestamp file used to determine when the project file is
   // out of date.
-  std::string stampName = this->Makefile->GetCurrentBinaryDirectory();
+  std::string stampName = this->GetCurrentBinaryDirectory();
   stampName += cmake::GetCMakeFilesDirectory();
   cmSystemTools::MakeDirectory(stampName.c_str());
   stampName += "/";
@@ -243,7 +243,7 @@ void cmLocalVisualStudio7Generator
   target.SetProperty("GENERATOR_FILE_NAME",lname.c_str());
   // create the dsp.cmake file
   std::string fname;
-  fname = this->Makefile->GetCurrentBinaryDirectory();
+  fname = this->GetCurrentBinaryDirectory();
   fname += "/";
   fname += lname;
   if(this->FortranProject)
@@ -272,7 +272,7 @@ void cmLocalVisualStudio7Generator
 //----------------------------------------------------------------------------
 cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
 {
-  std::string stampName = this->Makefile->GetCurrentBinaryDirectory();
+  std::string stampName = this->GetCurrentBinaryDirectory();
   stampName += "/";
   stampName += cmake::GetCMakeFilesDirectoryPostSlash();
   stampName += "generate.stamp";
@@ -1719,7 +1719,7 @@ cmLocalVisualStudio7Generator
   // files directory for any configuration.  This is used to construct
   // object file names that do not produce paths that are too long.
   std::string dir_max;
-  dir_max += this->Makefile->GetCurrentBinaryDirectory();
+  dir_max += this->GetCurrentBinaryDirectory();
   dir_max += "/";
   dir_max += this->GetTargetDirectory(target);
   dir_max += "/";
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 8c700a1..0b89d1d 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -419,7 +419,7 @@ void cmMakefileTargetGenerator
   this->WriteObjectBuildFile(obj, lang, source, depends);
 
   // The object file should be checked for dependency integrity.
-  std::string objFullPath = this->Makefile->GetCurrentBinaryDirectory();
+  std::string objFullPath = this->LocalGenerator->GetCurrentBinaryDirectory();
   objFullPath += "/";
   objFullPath += obj;
   objFullPath =
@@ -642,7 +642,7 @@ cmMakefileTargetGenerator
     this->LocalGenerator->ExpandRuleVariables(compileCommand, vars);
     std::string workingDirectory =
       this->LocalGenerator->Convert(
-        this->Makefile->GetCurrentBinaryDirectory(), cmLocalGenerator::FULL);
+        this->LocalGenerator->GetCurrentBinaryDirectory(), cmLocalGenerator::FULL);
     compileCommand.replace(compileCommand.find(langFlags),
                            langFlags.size(), this->GetFlags(lang));
     std::string langDefines = std::string("$(") + lang + "_DEFINES)";
@@ -698,7 +698,7 @@ cmMakefileTargetGenerator
   // Change the command working directory to the local build tree.
   this->LocalGenerator->CreateCDCommand
     (compileCommands,
-     this->Makefile->GetCurrentBinaryDirectory(),
+     this->LocalGenerator->GetCurrentBinaryDirectory(),
      cmLocalGenerator::HOME_OUTPUT);
   commands.insert(commands.end(),
                   compileCommands.begin(), compileCommands.end());
@@ -771,7 +771,7 @@ cmMakefileTargetGenerator
 
         this->LocalGenerator->CreateCDCommand
           (preprocessCommands,
-           this->Makefile->GetCurrentBinaryDirectory(),
+           this->LocalGenerator->GetCurrentBinaryDirectory(),
            cmLocalGenerator::HOME_OUTPUT);
         commands.insert(commands.end(),
                         preprocessCommands.begin(),
@@ -828,7 +828,7 @@ cmMakefileTargetGenerator
 
         this->LocalGenerator->CreateCDCommand
           (assemblyCommands,
-           this->Makefile->GetCurrentBinaryDirectory(),
+           this->LocalGenerator->GetCurrentBinaryDirectory(),
            cmLocalGenerator::HOME_OUTPUT);
         commands.insert(commands.end(),
                         assemblyCommands.begin(),
@@ -929,7 +929,7 @@ void cmMakefileTargetGenerator::WriteTargetCleanRules()
                                            *this->Target);
   this->LocalGenerator->CreateCDCommand
     (commands,
-     this->Makefile->GetCurrentBinaryDirectory(),
+     this->LocalGenerator->GetCurrentBinaryDirectory(),
      cmLocalGenerator::HOME_OUTPUT);
 
   // Write the rule.
@@ -1119,7 +1119,7 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
          << this->Convert(this->LocalGenerator->GetBinaryDirectory(),
                           cmLocalGenerator::FULL, cmLocalGenerator::SHELL)
          << " "
-         << this->Convert(this->Makefile->GetCurrentBinaryDirectory(),
+         << this->Convert(this->LocalGenerator->GetCurrentBinaryDirectory(),
                           cmLocalGenerator::FULL, cmLocalGenerator::SHELL)
          << " "
          << this->Convert(this->InfoFileNameFull,
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 2395ce7..8cefd7c 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -195,7 +195,7 @@ cmVisualStudio10TargetGenerator(cmTarget* target,
   this->BuildFileStream = 0;
   this->IsMissingFiles = false;
   this->DefaultArtifactDir =
-    this->Makefile->GetCurrentBinaryDirectory() + std::string("/") +
+    this->LocalGenerator->GetCurrentBinaryDirectory() + std::string("/") +
     this->LocalGenerator->GetTargetDirectory(*this->Target);
 }
 
@@ -297,8 +297,7 @@ void cmVisualStudio10TargetGenerator::Generate()
       return;
       }
     }
-  cmMakefile* mf = this->Target->GetMakefile();
-  std::string path =  mf->GetCurrentBinaryDirectory();
+  std::string path =  this->LocalGenerator->GetCurrentBinaryDirectory();
   path += "/";
   path += this->Name;
   path += ".vcxproj";
@@ -951,7 +950,7 @@ cmVisualStudio10TargetGenerator::ConvertPath(std::string const& path,
 {
   return forceRelative
     ? cmSystemTools::RelativePath(
-      this->Makefile->GetCurrentBinaryDirectory(), path.c_str())
+      this->LocalGenerator->GetCurrentBinaryDirectory(), path.c_str())
     : path.c_str();
 }
 
@@ -990,7 +989,7 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
   this->AddMissingSourceGroups(groupsUsed, sourceGroups);
 
   // Write out group file
-  std::string path =  this->Makefile->GetCurrentBinaryDirectory();
+  std::string path =  this->LocalGenerator->GetCurrentBinaryDirectory();
   path += "/";
   path += this->Name;
   path += ".vcxproj.filters";
@@ -1448,7 +1447,7 @@ void cmVisualStudio10TargetGenerator::WriteSource(
     std::string sourceRel = this->ConvertPath(sf->GetFullPath(), true);
     size_t const maxLen = 250;
     if(sf->GetCustomCommand() ||
-       ((strlen(this->Makefile->GetCurrentBinaryDirectory()) + 1 +
+       ((strlen(this->LocalGenerator->GetCurrentBinaryDirectory()) + 1 +
          sourceRel.length()) <= maxLen))
       {
       forceRelative = true;
@@ -3313,7 +3312,8 @@ void cmVisualStudio10TargetGenerator::WriteMissingFilesWP80()
   // For WP80, the manifest needs to be in the same folder as the project
   // this can cause an overwrite problem if projects aren't organized in
   // folders
-  std::string manifestFile = this->Makefile->GetCurrentBinaryDirectory() +
+  std::string manifestFile =
+      this->LocalGenerator->GetCurrentBinaryDirectory() +
                              std::string("/WMAppManifest.xml");
   std::string artifactDir =
     this->LocalGenerator->GetTargetDirectory(*this->Target);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5ce9220ececf0f71f9c2f14ed1b02e67ffefb56e
commit 5ce9220ececf0f71f9c2f14ed1b02e67ffefb56e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 7 01:17:48 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Oct 7 21:59:58 2015 +0200

    cmLocalGenerator: Add Home directory accessors.
    
    Reduce reasons for cmLocalGenerator to have a cmMakefile.

diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index d35b566..e97069f 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -1975,8 +1975,9 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
       else if(use_link_rpath)
         {
         // Do not add any path inside the source or build tree.
-        const char* topSourceDir = this->Makefile->GetHomeDirectory();
-        const char* topBinaryDir = this->Makefile->GetHomeOutputDirectory();
+        const char* topSourceDir = this->CMakeInstance->GetHomeDirectory();
+        const char* topBinaryDir =
+            this->CMakeInstance->GetHomeOutputDirectory();
         if(!cmSystemTools::ComparePath(*ri, topSourceDir) &&
            !cmSystemTools::ComparePath(*ri, topBinaryDir) &&
            !cmSystemTools::IsSubDirectory(*ri, topSourceDir) &&
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 2a9b72c..c9b6100 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -245,8 +245,10 @@ static bool checkInterfaceDirs(const std::string &prepro,
 {
   const char* installDir =
             target->Makefile->GetSafeDefinition("CMAKE_INSTALL_PREFIX");
-  const char* topSourceDir = target->Makefile->GetHomeDirectory();
-  const char* topBinaryDir = target->Makefile->GetHomeOutputDirectory();
+  const char* topSourceDir =
+      target->GetLocalGenerator()->GetSourceDirectory();
+  const char* topBinaryDir =
+      target->GetLocalGenerator()->GetBinaryDirectory();
 
   std::vector<std::string> parts;
   cmGeneratorExpression::Split(prepro, parts);
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 408daab..883b287 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -273,7 +273,7 @@ void cmExtraCodeBlocksGenerator
         }
 
       const std::string &relative = cmSystemTools::RelativePath(
-                         it->second[0]->GetMakefile()->GetHomeDirectory(),
+                         it->second[0]->GetSourceDirectory(),
                          jt->c_str());
       std::vector<std::string> splitted;
       cmSystemTools::SplitPath(relative, splitted, false);
@@ -297,7 +297,7 @@ void cmExtraCodeBlocksGenerator
   tree.BuildVirtualFolder(virtualFolders);
   // And one for <Unit>
   std::string unitFiles;
-  tree.BuildUnit(unitFiles, std::string(mf->GetHomeDirectory()) + "/");
+  tree.BuildUnit(unitFiles, std::string(lgs[0]->GetSourceDirectory()) + "/");
 
   // figure out the compiler
   std::string compiler = this->GetCBCompilerId(mf);
@@ -332,7 +332,7 @@ void cmExtraCodeBlocksGenerator
           // Only add the global targets from CMAKE_BINARY_DIR,
           // not from the subdirs
           if (strcmp(makefile->GetCurrentBinaryDirectory(),
-                     makefile->GetHomeOutputDirectory())==0)
+                     (*lg)->GetBinaryDirectory())==0)
             {
             this->AppendTarget(fout, ti->first, 0,
                                make.c_str(), *lg, compiler.c_str());
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index 1884da1..763673e 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -69,11 +69,11 @@ void cmExtraCodeLiteGenerator::Generate()
     this->ConfigName = GetConfigurationName( mf );
 
     if (strcmp(mf->GetCurrentBinaryDirectory(),
-               mf->GetHomeOutputDirectory()) == 0)
+               it->second[0]->GetBinaryDirectory()) == 0)
       {
       workspaceOutputDir   = mf->GetCurrentBinaryDirectory();
       workspaceProjectName = it->second[0]->GetProjectName();
-      workspaceSourcePath  = mf->GetHomeDirectory();
+      workspaceSourcePath  = it->second[0]->GetSourceDirectory();
       workspaceFileName    = workspaceOutputDir+"/";
       workspaceFileName   += workspaceProjectName + ".workspace";
       this->WorkspacePath = mf->GetCurrentBinaryDirectory();;
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 659a9ae..214e89f 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -79,8 +79,8 @@ void cmExtraEclipseCDT4Generator
 //----------------------------------------------------------------------------
 void cmExtraEclipseCDT4Generator::Generate()
 {
-  const cmMakefile* mf
-    = this->GlobalGenerator->GetLocalGenerators()[0]->GetMakefile();
+  cmLocalGenerator* lg = this->GlobalGenerator->GetLocalGenerators()[0];
+  const cmMakefile* mf = lg->GetMakefile();
 
   std::string eclipseVersion = mf->GetSafeDefinition("CMAKE_ECLIPSE_VERSION");
   cmsys::RegularExpression regex(".*([0-9]+\\.[0-9]+).*");
@@ -106,8 +106,8 @@ void cmExtraEclipseCDT4Generator::Generate()
     }
 
   // TODO: Decide if these are local or member variables
-  this->HomeDirectory       = mf->GetHomeDirectory();
-  this->HomeOutputDirectory = mf->GetHomeOutputDirectory();
+  this->HomeDirectory       = lg->GetSourceDirectory();
+  this->HomeOutputDirectory = lg->GetBinaryDirectory();
 
   this->GenerateLinkedResources = mf->IsOn(
                                     "CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES");
@@ -226,7 +226,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout,
     mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(),
                            cacheEntryName.c_str(), cmState::STRING,
                            true);
-    mf->GetCMakeInstance()->SaveCache(mf->GetHomeOutputDirectory());
+    mf->GetCMakeInstance()->SaveCache(lg->GetBinaryDirectory());
     }
   else if (envVarValue==0 && cacheValue!=0)
     {
@@ -247,7 +247,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout,
       mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(),
                              cacheEntryName.c_str(), cmState::STRING,
                              true);
-      mf->GetCMakeInstance()->SaveCache(mf->GetHomeOutputDirectory());
+      mf->GetCMakeInstance()->SaveCache(lg->GetBinaryDirectory());
       }
     }
 
@@ -1089,7 +1089,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
           virtDir += prefix;
           virtDir += ti->first;
           std::string buildArgs = "-C \"";
-          buildArgs += makefile->GetHomeOutputDirectory();
+          buildArgs += (*it)->GetBinaryDirectory();
           buildArgs += "\" ";
           buildArgs += makeArgs;
           this->AppendTarget(fout, "Build", make, buildArgs, virtDir, "",
diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx
index 104372c..f14a1cc 100644
--- a/Source/cmExtraKateGenerator.cxx
+++ b/Source/cmExtraKateGenerator.cxx
@@ -50,7 +50,7 @@ void cmExtraKateGenerator::Generate()
   const cmMakefile* mf = lg->GetMakefile();
   this->ProjectName = this->GenerateProjectName(lg->GetProjectName(),
                           mf->GetSafeDefinition("CMAKE_BUILD_TYPE"),
-                          this->GetPathBasename(mf->GetHomeOutputDirectory()));
+                          this->GetPathBasename(lg->GetBinaryDirectory()));
   this->UseNinja = (this->GlobalGenerator->GetName() == "Ninja");
 
   this->CreateKateProjectFile(lg);
@@ -61,8 +61,7 @@ void cmExtraKateGenerator::Generate()
 void cmExtraKateGenerator::CreateKateProjectFile(
     const cmLocalGenerator* lg) const
 {
-  const cmMakefile* mf = lg->GetMakefile();
-  std::string filename = mf->GetHomeOutputDirectory();
+  std::string filename = lg->GetBinaryDirectory();
   filename += "/.kateproject";
   cmGeneratedFileStream fout(filename.c_str());
   if (!fout)
@@ -73,9 +72,9 @@ void cmExtraKateGenerator::CreateKateProjectFile(
   fout <<
     "{\n"
     "\t\"name\": \"" << this->ProjectName << "\",\n"
-    "\t\"directory\": \"" << mf->GetHomeDirectory() << "\",\n"
-    "\t\"files\": [ { " << this->GenerateFilesString(mf) << "} ],\n";
-  this->WriteTargets(mf, fout);
+    "\t\"directory\": \"" << lg->GetSourceDirectory() << "\",\n"
+    "\t\"files\": [ { " << this->GenerateFilesString(lg) << "} ],\n";
+  this->WriteTargets(lg, fout);
   fout << "}\n";
 }
 
@@ -84,15 +83,15 @@ void
 cmExtraKateGenerator::WriteTargets(const cmLocalGenerator* lg,
                                    cmGeneratedFileStream& fout) const
 {
-  cmMakefile* mf = lg->GetMakefile();
+  cmMakefile const* mf = lg->GetMakefile();
   const std::string make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM");
   const std::string makeArgs = mf->GetSafeDefinition(
     "CMAKE_KATE_MAKE_ARGUMENTS");
-  const char* homeOutputDir = mf->GetHomeOutputDirectory();
+  const char* homeOutputDir = lg->GetBinaryDirectory();
 
   fout <<
   "\t\"build\": {\n"
-  "\t\t\"directory\": \"" << mf->GetHomeOutputDirectory() << "\",\n"
+  "\t\t\"directory\": \"" << lg->GetBinaryDirectory() << "\",\n"
   "\t\t\"default_target\": \"all\",\n"
   "\t\t\"clean_target\": \"clean\",\n";
 
@@ -123,7 +122,7 @@ cmExtraKateGenerator::WriteTargets(const cmLocalGenerator* lg,
     const cmTargets& targets = (*it)->GetMakefile()->GetTargets();
     cmMakefile* makefile=(*it)->GetMakefile();
     std::string currentDir = makefile->GetCurrentBinaryDirectory();
-    bool topLevel = (currentDir == makefile->GetHomeOutputDirectory());
+    bool topLevel = (currentDir == (*it)->GetBinaryDirectory());
 
     for(cmTargets::const_iterator ti=targets.begin(); ti!=targets.end(); ++ti)
       {
@@ -237,8 +236,7 @@ void
 cmExtraKateGenerator::CreateDummyKateProjectFile(
     const cmLocalGenerator* lg) const
 {
-  cmMakefile* mf = lg->GetMakefile();
-  std::string filename = mf->GetHomeOutputDirectory();
+  std::string filename = lg->GetBinaryDirectory();
   filename += "/";
   filename += this->ProjectName;
   filename += ".kateproject";
@@ -256,22 +254,21 @@ cmExtraKateGenerator::CreateDummyKateProjectFile(
 std::string
 cmExtraKateGenerator::GenerateFilesString(const cmLocalGenerator* lg) const
 {
-  cmMakefile* mf = lg->GetMakefile();
-  std::string s = mf->GetHomeDirectory();
+  std::string s = lg->GetSourceDirectory();
   s += "/.git";
   if(cmSystemTools::FileExists(s.c_str()))
   {
     return std::string("\"git\": 1 ");
   }
 
-  s = mf->GetHomeDirectory();
+  s = lg->GetSourceDirectory();
   s += "/.svn";
   if(cmSystemTools::FileExists(s.c_str()))
   {
     return std::string("\"svn\": 1 ");
   }
 
-  s = mf->GetHomeDirectory();
+  s = lg->GetSourceDirectory();
   s += "/";
 
   std::set<std::string> files;
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index 363ab2f..21587d6 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -99,8 +99,8 @@ void cmExtraSublimeTextGenerator
     }
 
   const std::string &sourceRootRelativeToOutput = cmSystemTools::RelativePath(
-                     mf->GetHomeOutputDirectory(),
-                     mf->GetHomeDirectory());
+                     lgs[0]->GetBinaryDirectory(),
+                     lgs[0]->GetSourceDirectory());
   // Write the folder entries to the project file
   fout << "{\n";
   fout << "\t\"folders\":\n\t[\n\t";
@@ -108,8 +108,8 @@ void cmExtraSublimeTextGenerator
     {
       fout << "\t{\n\t\t\t\"path\": \"" << sourceRootRelativeToOutput << "\"";
       const std::string &outputRelativeToSourceRoot =
-        cmSystemTools::RelativePath(mf->GetHomeDirectory(),
-                                    mf->GetHomeOutputDirectory());
+        cmSystemTools::RelativePath(lgs[0]->GetSourceDirectory(),
+                                    lgs[0]->GetBinaryDirectory());
       if ((!outputRelativeToSourceRoot.empty()) &&
         ((outputRelativeToSourceRoot.length() < 3) ||
           (outputRelativeToSourceRoot.substr(0, 3) != "../")))
@@ -173,8 +173,8 @@ void cmExtraSublimeTextGenerator::
           {
           // Only add the global targets from CMAKE_BINARY_DIR,
           // not from the subdirs
-          if (strcmp(makefile->GetCurrentBinaryDirectory(),
-                     makefile->GetHomeOutputDirectory())==0)
+          if (strcmp((*lg)->GetCurrentBinaryDirectory(),
+                     (*lg)->GetBinaryDirectory())==0)
             {
             this->AppendTarget(fout, ti->first, *lg, 0,
                                make.c_str(), makefile, compiler.c_str(),
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index cae5c2f..4a362d8 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -68,7 +68,9 @@ cmGhsMultiTargetGenerator::GetRelBuildFilePath(const cmTarget *target)
 std::string
 cmGhsMultiTargetGenerator::GetAbsPathToRoot(const cmTarget *target)
 {
-  return target->GetMakefile()->GetHomeOutputDirectory();
+  cmGeneratorTarget* gt = target->GetMakefile()->GetGlobalGenerator()
+      ->GetGeneratorTarget(target);
+  return gt->GetLocalGenerator()->GetBinaryDirectory();
 }
 
 std::string
@@ -449,7 +451,7 @@ void cmGhsMultiTargetGenerator::WriteSources(
     cmSystemTools::ConvertToUnixSlashes(sgPath);
     cmGlobalGhsMultiGenerator::AddFilesUpToPath(
       this->GetFolderBuildStreams(), &this->FolderBuildStreams,
-      this->Makefile->GetHomeOutputDirectory(), sgPath,
+      this->LocalGenerator->GetBinaryDirectory(), sgPath,
       GhsMultiGpj::SUBPROJECT, this->RelBuildFilePath);
 
     std::string fullSourcePath((*si)->GetFullPath());
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 05f1029..57a8741 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -399,7 +399,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
   bool fatalError = false;
 
   mf->AddDefinition("RUN_CONFIGURE", true);
-  std::string rootBin = mf->GetHomeOutputDirectory();
+  std::string rootBin = this->CMakeInstance->GetHomeOutputDirectory();
   rootBin += cmake::GetCMakeFilesDirectory();
 
   // If the configuration files path has been set,
@@ -2879,10 +2879,8 @@ void cmGlobalGenerator::WriteRuleHashes(std::string const& pfile)
 //----------------------------------------------------------------------------
 void cmGlobalGenerator::WriteSummary()
 {
-  cmMakefile* mf = this->LocalGenerators[0]->GetMakefile();
-
   // Record all target directories in a central location.
-  std::string fname = mf->GetHomeOutputDirectory();
+  std::string fname = this->CMakeInstance->GetHomeOutputDirectory();
   fname += cmake::GetCMakeFilesDirectory();
   fname += "/TargetDirectories.txt";
   cmGeneratedFileStream fout(fname.c_str());
diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx
index 6290907..f82fcb3 100644
--- a/Source/cmGlobalKdevelopGenerator.cxx
+++ b/Source/cmGlobalKdevelopGenerator.cxx
@@ -51,7 +51,7 @@ void cmGlobalKdevelopGenerator::Generate()
     {
     cmMakefile* mf = it->second[0]->GetMakefile();
     std::string outputDir=mf->GetCurrentBinaryDirectory();
-    std::string projectDir=mf->GetHomeDirectory();
+    std::string projectDir=it->second[0]->GetSourceDirectory();
     std::string projectName=it->second[0]->GetProjectName();
     std::string cmakeFilePattern("CMakeLists.txt;*.cmake;");
     std::string fileToOpen;
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 9d8193b..32e6077 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -1198,16 +1198,15 @@ void cmGlobalNinjaGenerator::WriteTargetAll(std::ostream& os)
 void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
 {
   cmLocalGenerator *lg = this->LocalGenerators[0];
-  cmMakefile* mfRoot = lg->GetMakefile();
 
   std::ostringstream cmd;
   cmd << lg->ConvertToOutputFormat(cmSystemTools::GetCMakeCommand(),
                                    cmLocalGenerator::SHELL)
       << " -H"
-      << lg->ConvertToOutputFormat(mfRoot->GetHomeDirectory(),
+      << lg->ConvertToOutputFormat(lg->GetSourceDirectory(),
                                    cmLocalGenerator::SHELL)
       << " -B"
-      << lg->ConvertToOutputFormat(mfRoot->GetHomeOutputDirectory(),
+      << lg->ConvertToOutputFormat(lg->GetBinaryDirectory(),
                                    cmLocalGenerator::SHELL);
   WriteRule(*this->RulesFileStream,
             "RERUN_CMAKE",
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 0064713..59633d9 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -785,7 +785,7 @@ cmGlobalUnixMakefileGenerator3
       depends.clear();
 
       cmLocalUnixMakefileGenerator3::EchoProgress progress;
-      progress.Dir = lg->GetMakefile()->GetHomeOutputDirectory();
+      progress.Dir = lg->GetBinaryDirectory();
       progress.Dir += cmake::GetCMakeFilesDirectory();
       {
       std::ostringstream progressArg;
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 86a8f87..0a6844e 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -312,10 +312,10 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget()
   cmCustomCommandLine commandLine;
   commandLine.push_back(cmSystemTools::GetCMakeCommand());
   std::string argH = "-H";
-  argH += mf->GetHomeDirectory();
+  argH += lg->GetSourceDirectory();
   commandLine.push_back(argH);
   std::string argB = "-B";
-  argB += mf->GetHomeOutputDirectory();
+  argB += lg->GetBinaryDirectory();
   commandLine.push_back(argB);
   commandLine.push_back("--check-stamp-list");
   commandLine.push_back(stampList.c_str());
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 840e89f..b40d5b7 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -588,7 +588,7 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile(
     (this->CurrentReRunCMakeMakefile.c_str());
   makefileStream.SetCopyIfDifferent(true);
   makefileStream << "# Generated by CMake, DO NOT EDIT\n";
-  std::string checkCache = mf->GetHomeOutputDirectory();
+  std::string checkCache = root->GetBinaryDirectory();
   checkCache += "/";
   checkCache += cmake::GetCMakeFilesDirectoryPostSlash();
   checkCache += "cmake.check_cache";
@@ -602,9 +602,9 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile(
   makefileStream << "\n\t" <<
     this->ConvertToRelativeForMake(cmSystemTools::GetCMakeCommand().c_str())
                  << " -H" << this->ConvertToRelativeForMake(
-                   mf->GetHomeDirectory())
+                   root->GetSourceDirectory())
                  << " -B" << this->ConvertToRelativeForMake(
-                   mf->GetHomeOutputDirectory()) << "\n";
+                   root->GetBinaryDirectory()) << "\n";
 }
 
 //----------------------------------------------------------------------------
@@ -3746,7 +3746,7 @@ cmGlobalXCodeGenerator::OutputXCodeProject(cmLocalGenerator* root,
   // Since this call may have created new cache entries, save the cache:
   //
   root->GetMakefile()->GetCMakeInstance()->SaveCache(
-    root->GetMakefile()->GetHomeOutputDirectory());
+    root->GetBinaryDirectory());
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index b7833cd..6c442f4 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2868,6 +2868,16 @@ cmake* cmLocalGenerator::GetCMakeInstance() const
   return this->GlobalGenerator->GetCMakeInstance();
 }
 
+const char* cmLocalGenerator::GetSourceDirectory() const
+{
+  return this->GetCMakeInstance()->GetHomeDirectory();
+}
+
+const char* cmLocalGenerator::GetBinaryDirectory() const
+{
+  return this->GetCMakeInstance()->GetHomeOutputDirectory();
+}
+
 //----------------------------------------------------------------------------
 std::string
 cmLocalGenerator::GetTargetDirectory(cmTarget const&) const
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index b3bf8cd..2123f1e 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -255,6 +255,9 @@ public:
 
   cmake* GetCMakeInstance() const;
 
+  const char* GetSourceDirectory() const;
+  const char* GetBinaryDirectory() const;
+
   /**
    * Generate a Mac OS X application bundle Info.plist file.
    */
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index b131a63..bf5afc1 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -399,7 +399,7 @@ cmLocalUnixMakefileGenerator3
       );
     }
   this->CreateCDCommand(commands,
-                        this->Makefile->GetHomeOutputDirectory(),
+                        this->GetBinaryDirectory(),
                         cmLocalGenerator::START_OUTPUT);
 
   // Write the rule to the makefile.
@@ -449,7 +449,7 @@ void cmLocalUnixMakefileGenerator3
       commands.push_back(this->GetRecursiveMakeCall
                          (makefile2.c_str(),localName));
       this->CreateCDCommand(commands,
-                            this->Makefile->GetHomeOutputDirectory(),
+                            this->GetBinaryDirectory(),
                             cmLocalGenerator::START_OUTPUT);
       this->WriteMakeRule(ruleFileStream, "Convenience name for target.",
                           localName, depends, commands, true);
@@ -478,7 +478,7 @@ void cmLocalUnixMakefileGenerator3
       commands.push_back(this->GetRecursiveMakeCall
                          (makefileName.c_str(), makeTargetName));
       this->CreateCDCommand(commands,
-                            this->Makefile->GetHomeOutputDirectory(),
+                            this->GetBinaryDirectory(),
                             cmLocalGenerator::START_OUTPUT);
       this->WriteMakeRule(ruleFileStream, "fast build rule for target.",
                           localName, depends, commands, true);
@@ -496,7 +496,7 @@ void cmLocalUnixMakefileGenerator3
         commands.push_back(this->GetRecursiveMakeCall
                            (makefile2.c_str(), makeTargetName));
         this->CreateCDCommand(commands,
-                              this->Makefile->GetHomeOutputDirectory(),
+                              this->GetBinaryDirectory(),
                               cmLocalGenerator::START_OUTPUT);
         this->WriteMakeRule(ruleFileStream,
                             "Manual pre-install relink rule for target.",
@@ -750,13 +750,13 @@ cmLocalUnixMakefileGenerator3
   makefileStream
     << "# The top-level source directory on which CMake was run.\n"
     << "CMAKE_SOURCE_DIR = "
-    << this->Convert(this->Makefile->GetHomeDirectory(), FULL, SHELL)
+    << this->Convert(this->GetSourceDirectory(), FULL, SHELL)
     << "\n"
     << "\n";
   makefileStream
     << "# The top-level build directory on which CMake was run.\n"
     << "CMAKE_BINARY_DIR = "
-    << this->Convert(this->Makefile->GetHomeOutputDirectory(), FULL, SHELL)
+    << this->Convert(this->GetBinaryDirectory(), FULL, SHELL)
     << "\n"
     << "\n";
 }
@@ -889,7 +889,7 @@ void cmLocalUnixMakefileGenerator3
   if(!this->GetMakefile()->IsRootMakefile())
     {
     this->CreateCDCommand(commands,
-                          this->Makefile->GetHomeOutputDirectory(),
+                          this->GetBinaryDirectory(),
                           cmLocalGenerator::START_OUTPUT);
     }
   this->WriteMakeRule(makefileStream,
@@ -1838,7 +1838,7 @@ void cmLocalUnixMakefileGenerator3
 
   depends.push_back("cmake_check_build_system");
 
-  std::string progressDir = this->Makefile->GetHomeOutputDirectory();
+  std::string progressDir = this->GetBinaryDirectory();
   progressDir += cmake::GetCMakeFilesDirectory();
     {
     std::ostringstream progCmd;
@@ -1862,7 +1862,7 @@ void cmLocalUnixMakefileGenerator3
   commands.push_back(this->GetRecursiveMakeCall(mf2Dir.c_str(),
                                                 recursiveTarget));
   this->CreateCDCommand(commands,
-                        this->Makefile->GetHomeOutputDirectory(),
+                        this->GetBinaryDirectory(),
                         cmLocalGenerator::START_OUTPUT);
     {
     std::ostringstream progCmd;
@@ -1884,7 +1884,7 @@ void cmLocalUnixMakefileGenerator3
   commands.push_back(this->GetRecursiveMakeCall(mf2Dir.c_str(),
                                                 recursiveTarget));
   this->CreateCDCommand(commands,
-                                this->Makefile->GetHomeOutputDirectory(),
+                                this->GetBinaryDirectory(),
                                 cmLocalGenerator::START_OUTPUT);
   this->WriteMakeRule(ruleFileStream, "The main clean target", "clean",
                       depends, commands, true);
@@ -1914,7 +1914,7 @@ void cmLocalUnixMakefileGenerator3
   commands.push_back
     (this->GetRecursiveMakeCall(mf2Dir.c_str(), recursiveTarget));
   this->CreateCDCommand(commands,
-                        this->Makefile->GetHomeOutputDirectory(),
+                        this->GetBinaryDirectory(),
                         cmLocalGenerator::START_OUTPUT);
   this->WriteMakeRule(ruleFileStream, "Prepare targets for installation.",
                       "preinstall", depends, commands, true);
@@ -1935,7 +1935,7 @@ void cmLocalUnixMakefileGenerator3
   runRule += " 1";
   commands.push_back(runRule);
   this->CreateCDCommand(commands,
-                        this->Makefile->GetHomeOutputDirectory(),
+                        this->GetBinaryDirectory(),
                         cmLocalGenerator::START_OUTPUT);
   this->WriteMakeRule(ruleFileStream, "clear depends",
                       "depend",
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index cc94cd4..66b3dd3 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -112,7 +112,7 @@ void cmLocalVisualStudio6Generator::OutputDSPFile()
 {
   // If not an in source build, then create the output directory
   if(strcmp(this->Makefile->GetCurrentBinaryDirectory(),
-            this->Makefile->GetHomeDirectory()) != 0)
+            this->GetSourceDirectory()) != 0)
     {
     if(!cmSystemTools::MakeDirectory
        (this->Makefile->GetCurrentBinaryDirectory()))
@@ -226,10 +226,10 @@ void cmLocalVisualStudio6Generator::AddDSPBuildRule(cmTarget& tgt)
   comment += makefileIn;
   std::string args;
   args = "-H";
-  args += this->Makefile->GetHomeDirectory();
+  args += this->GetSourceDirectory();
   commandLine.push_back(args);
   args = "-B";
-  args += this->Makefile->GetHomeOutputDirectory();
+  args += this->GetBinaryDirectory();
   commandLine.push_back(args);
 
   std::vector<std::string> const& listFiles = this->Makefile->GetListFiles();
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index a4bce8a..9c25651 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -161,7 +161,7 @@ void cmLocalVisualStudio7Generator::WriteProjectFiles()
 {
   // If not an in source build, then create the output directory
   if(strcmp(this->Makefile->GetCurrentBinaryDirectory(),
-            this->Makefile->GetHomeDirectory()) != 0)
+            this->GetSourceDirectory()) != 0)
     {
     if(!cmSystemTools::MakeDirectory
        (this->Makefile->GetCurrentBinaryDirectory()))
@@ -290,10 +290,10 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
   comment += makefileIn;
   std::string args;
   args = "-H";
-  args += this->Makefile->GetHomeDirectory();
+  args += this->GetSourceDirectory();
   commandLine.push_back(args);
   args = "-B";
-  args += this->Makefile->GetHomeOutputDirectory();
+  args += this->GetBinaryDirectory();
   commandLine.push_back(args);
   commandLine.push_back("--check-stamp-file");
   std::string stampFilename = this->Convert(stampName.c_str(), FULL,
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index b278087..8c700a1 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1095,7 +1095,7 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
   // translation table for the dependency scanning process.
   depCmd << "cd "
          << (this->LocalGenerator->Convert(
-               this->Makefile->GetHomeOutputDirectory(),
+               this->LocalGenerator->GetBinaryDirectory(),
                cmLocalGenerator::FULL, cmLocalGenerator::SHELL))
          << " && ";
 #endif
@@ -1110,13 +1110,13 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
   // the state of our local generator sufficiently for its needs.
   depCmd << "$(CMAKE_COMMAND) -E cmake_depends \""
          << this->GlobalGenerator->GetName() << "\" "
-         << this->Convert(this->Makefile->GetHomeDirectory(),
+         << this->Convert(this->LocalGenerator->GetSourceDirectory(),
                           cmLocalGenerator::FULL, cmLocalGenerator::SHELL)
          << " "
          << this->Convert(this->Makefile->GetCurrentSourceDirectory(),
                           cmLocalGenerator::FULL, cmLocalGenerator::SHELL)
          << " "
-         << this->Convert(this->Makefile->GetHomeOutputDirectory(),
+         << this->Convert(this->LocalGenerator->GetBinaryDirectory(),
                           cmLocalGenerator::FULL, cmLocalGenerator::SHELL)
          << " "
          << this->Convert(this->Makefile->GetCurrentBinaryDirectory(),
@@ -1242,7 +1242,7 @@ void
 cmMakefileTargetGenerator
 ::MakeEchoProgress(cmLocalUnixMakefileGenerator3::EchoProgress& progress) const
 {
-  progress.Dir = this->Makefile->GetHomeOutputDirectory();
+  progress.Dir = this->LocalGenerator->GetBinaryDirectory();
   progress.Dir += cmake::GetCMakeFilesDirectory();
   std::ostringstream progressArg;
   progressArg << "$(CMAKE_PROGRESS_" << this->NumberOfProgressActions << ")";
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 84c19a3..fb598e8 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -666,8 +666,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
   if (!preLinkCmdLines.empty())
     {
     const std::string homeOutDir = localGen.ConvertToOutputFormat(
-                                              mf->GetHomeOutputDirectory(),
-                                              cmLocalGenerator::SHELL);
+                                            localGen.GetBinaryDirectory(),
+                                            cmLocalGenerator::SHELL);
     preLinkCmdLines.push_back("cd " + homeOutDir);
     }
 
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 6e6dc60..d792ba7 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -47,7 +47,7 @@ cmNinjaTargetGenerator::New(cmGeneratorTarget* target)
         // in every directory, which we don't need.
         cmMakefile *mf = target->Target->GetMakefile();
         if (strcmp(mf->GetCurrentSourceDirectory(),
-                   mf->GetHomeDirectory()) == 0)
+                   target->GetLocalGenerator()->GetSourceDirectory()) == 0)
           return new cmNinjaUtilityTargetGenerator(target);
         // else fallthrough
       }
diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx
index 58b901a..3e36589 100644
--- a/Source/cmNinjaUtilityTargetGenerator.cxx
+++ b/Source/cmNinjaUtilityTargetGenerator.cxx
@@ -103,13 +103,13 @@ void cmNinjaUtilityTargetGenerator::Generate()
       command,
       "$(CMAKE_SOURCE_DIR)",
       this->GetLocalGenerator()->ConvertToOutputFormat(
-        this->GetTarget()->GetMakefile()->GetHomeDirectory(),
+        this->GetLocalGenerator()->GetSourceDirectory(),
         cmLocalGenerator::SHELL).c_str());
     cmSystemTools::ReplaceString(
       command,
       "$(CMAKE_BINARY_DIR)",
       this->GetLocalGenerator()->ConvertToOutputFormat(
-        this->GetTarget()->GetMakefile()->GetHomeOutputDirectory(),
+        this->GetLocalGenerator()->GetBinaryDirectory(),
         cmLocalGenerator::SHELL).c_str());
     cmSystemTools::ReplaceString(command, "$(ARGS)", "");
 

-----------------------------------------------------------------------

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list