From 4c41e74da58b6f1057466e7eaa22942dc62c8802 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 21 Oct 2015 19:59:12 +0200 Subject: [PATCH] Use cmLocalGenerator at generate-time. --- Source/cmCommonTargetGenerator.cxx | 2 +- Source/cmExportFileGenerator.cxx | 12 ++++++------ Source/cmGlobalNinjaGenerator.cxx | 4 ++-- Source/cmGlobalUnixMakefileGenerator3.cxx | 2 +- Source/cmInstallTargetGenerator.cxx | 4 ++-- Source/cmLocalGenerator.cxx | 2 +- Source/cmLocalUnixMakefileGenerator3.cxx | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx index 6920fafe3..2c47ab282 100644 --- a/Source/cmCommonTargetGenerator.cxx +++ b/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; } diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 1a84625d0..d52ce35b3 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/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; } diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 89a6dff28..6e650ceb3 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/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 { diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 2a5b1530e..4d7ca2577 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/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 += "/"; diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 7a10356a8..59d06f6e0 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/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; } diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 2166c09e9..c37417ddf 100644 --- a/Source/cmLocalGenerator.cxx +++ b/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()); } diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index dae8aaf67..e9dc9ff05 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -188,7 +188,7 @@ GetLocalObjectFiles(std::map &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 += "/";