Use cmLocalGenerator at generate-time.

This commit is contained in:
Stephen Kelly 2015-10-21 19:59:12 +02:00
parent 67b2f4312c
commit 4c41e74da5
7 changed files with 14 additions and 14 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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