Browse Source

Use cmLocalGenerator at generate-time.

Stephen Kelly 10 years ago
parent
commit
4c41e74da5

+ 1 - 1
Source/cmCommonTargetGenerator.cxx

@@ -123,7 +123,7 @@ std::string cmCommonTargetGenerator::ComputeFortranModuleDirectory() const
     else
       {
       // Interpret relative to the current output directory.
-      mod_dir = this->Makefile->GetCurrentBinaryDirectory();
+      mod_dir = this->LocalGenerator->GetCurrentBinaryDirectory();
       mod_dir += "/";
       mod_dir += target_mod_dir;
       }

+ 6 - 6
Source/cmExportFileGenerator.cxx

@@ -456,13 +456,13 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
 
   if (cge->GetHadContextSensitiveCondition())
     {
-    cmMakefile* mf = target->Target->GetMakefile();
+    cmLocalGenerator* lg = target->GetLocalGenerator();
     std::ostringstream e;
     e << "Target \"" << target->GetName() << "\" is installed with "
     "INCLUDES DESTINATION set to a context sensitive path.  Paths which "
     "depend on the configuration, policy values or the link interface are "
     "not supported.  Consider using target_include_directories instead.";
-    mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+    lg->IssueMessage(cmake::FATAL_ERROR, e.str());
     return;
     }
 
@@ -535,11 +535,11 @@ void getCompatibleInterfaceProperties(cmGeneratorTarget *target,
 
   if (!info)
     {
-    cmMakefile* mf = target->Target->GetMakefile();
+    cmLocalGenerator* lg = target->GetLocalGenerator();
     std::ostringstream e;
     e << "Exporting the target \"" << target->GetName() << "\" is not "
         "allowed since its linker language cannot be determined";
-    mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+    lg->IssueMessage(cmake::FATAL_ERROR, e.str());
     return;
     }
 
@@ -835,13 +835,13 @@ cmExportFileGenerator
 
   if(newCMP0022Behavior && !this->ExportOld)
     {
-    cmMakefile *mf = target->Target->GetMakefile();
+    cmLocalGenerator *lg = target->GetLocalGenerator();
     std::ostringstream e;
     e << "Target \"" << target->GetName() << "\" has policy CMP0022 enabled, "
          "but also has old-style LINK_INTERFACE_LIBRARIES properties "
          "populated, but it was exported without the "
          "EXPORT_LINK_INTERFACE_LIBRARIES to export the old-style properties";
-    mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+    lg->IssueMessage(cmake::FATAL_ERROR, e.str());
     return;
     }
 

+ 2 - 2
Source/cmGlobalNinjaGenerator.cxx

@@ -719,7 +719,7 @@ void cmGlobalNinjaGenerator
 {
   // Compute full path to object file directory for this target.
   std::string dir;
-  dir += gt->Makefile->GetCurrentBinaryDirectory();
+  dir += gt->LocalGenerator->GetCurrentBinaryDirectory();
   dir += "/";
   dir += gt->LocalGenerator->GetTargetDirectory(gt);
   dir += "/";
@@ -938,7 +938,7 @@ cmGlobalNinjaGenerator
   case cmState::OBJECT_LIBRARY:
   case cmState::UTILITY: {
     std::string path = this->ConvertToNinjaPath(
-      target->GetMakefile()->GetCurrentBinaryDirectory());
+      target->GetLocalGenerator()->GetCurrentBinaryDirectory());
     if (path.empty() || path == ".")
       outputs.push_back(target->GetName());
     else {

+ 1 - 1
Source/cmGlobalUnixMakefileGenerator3.cxx

@@ -116,7 +116,7 @@ cmGlobalUnixMakefileGenerator3
 {
   // Compute full path to object file directory for this target.
   std::string dir;
-  dir += gt->Makefile->GetCurrentBinaryDirectory();
+  dir += gt->LocalGenerator->GetCurrentBinaryDirectory();
   dir += "/";
   dir += gt->LocalGenerator->GetTargetDirectory(gt);
   dir += "/";

+ 2 - 2
Source/cmInstallTargetGenerator.cxx

@@ -76,7 +76,7 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
   if(this->Target->NeedRelinkBeforeInstall(config))
     {
     fromDirConfig =
-        this->Target->Target->GetMakefile()->GetCurrentBinaryDirectory();
+        this->Target->GetLocalGenerator()->GetCurrentBinaryDirectory();
     fromDirConfig += cmake::GetCMakeFilesDirectory();
     fromDirConfig += "/CMakeRelink.dir/";
     }
@@ -111,7 +111,7 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
     case cmState::UTILITY:
     case cmState::GLOBAL_TARGET:
     case cmState::UNKNOWN_LIBRARY:
-      this->Target->Target->GetMakefile()->IssueMessage(cmake::INTERNAL_ERROR,
+      this->Target->GetLocalGenerator()->IssueMessage(cmake::INTERNAL_ERROR,
         "cmInstallTargetGenerator created with non-installable target.");
       return;
     }

+ 1 - 1
Source/cmLocalGenerator.cxx

@@ -2140,7 +2140,7 @@ void cmLocalGenerator
       "has the following visibility properties set for " << lang << ":\n" <<
       warnCMP0063 <<
       "For compatibility CMake is not honoring them for this target.";
-    target->Target->GetMakefile()->GetCMakeInstance()
+    target->GetLocalGenerator()->GetCMakeInstance()
       ->IssueMessage(cmake::AUTHOR_WARNING, w.str(),
                      target->GetBacktrace());
     }

+ 1 - 1
Source/cmLocalUnixMakefileGenerator3.cxx

@@ -188,7 +188,7 @@ GetLocalObjectFiles(std::map<std::string, LocalObjectInfo> &localObjectFiles)
                                     ->GetSafeDefinition("CMAKE_BUILD_TYPE"));
     // Compute full path to object file directory for this target.
     std::string dir;
-    dir += gt->Makefile->GetCurrentBinaryDirectory();
+    dir += gt->LocalGenerator->GetCurrentBinaryDirectory();
     dir += "/";
     dir += this->GetTargetDirectory(gt);
     dir += "/";