From e6661282436d7901617d2f96d9acf9d4cb7db9d5 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 17 Oct 2015 15:05:46 +0200 Subject: Export: Port internal utility to cmGeneratorTarget. --- Source/cmExportBuildFileGenerator.cxx | 15 ++++++++------- Source/cmExportBuildFileGenerator.h | 8 ++++---- Source/cmExportFileGenerator.cxx | 2 +- Source/cmExportFileGenerator.h | 4 ++-- Source/cmExportInstallFileGenerator.cxx | 14 +++++++------- Source/cmExportInstallFileGenerator.h | 8 ++++---- Source/cmExportTryCompileFileGenerator.h | 4 ++-- 7 files changed, 28 insertions(+), 27 deletions(-) diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index c24138f..cf84146 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -237,14 +237,15 @@ void cmExportBuildFileGenerator::HandleMissingTarget( std::string& link_libs, std::vector& missingTargets, - cmTarget* depender, - cmTarget* dependee) + cmGeneratorTarget* depender, + cmGeneratorTarget* dependee) { // The target is not in the export. if(!this->AppendMode) { const std::string name = dependee->GetName(); - cmGlobalGenerator* gg = dependee->GetMakefile()->GetGlobalGenerator(); + cmGlobalGenerator* gg = + dependee->GetLocalGenerator()->GetGlobalGenerator(); std::vector namespaces = this->FindNamespaces(gg, name); int targetOccurrences = (int)namespaces.size(); @@ -252,7 +253,7 @@ cmExportBuildFileGenerator::HandleMissingTarget( { std::string missingTarget = namespaces[0]; - missingTarget += dependee->GetExportName(); + missingTarget += dependee->Target->GetExportName(); link_libs += missingTarget; missingTargets.push_back(missingTarget); return; @@ -267,7 +268,7 @@ cmExportBuildFileGenerator::HandleMissingTarget( // Assume the target will be exported by another command. // Append it with the export namespace. link_libs += this->Namespace; - link_libs += dependee->GetExportName(); + link_libs += dependee->Target->GetExportName(); } //---------------------------------------------------------------------------- @@ -315,8 +316,8 @@ cmExportBuildFileGenerator //---------------------------------------------------------------------------- void cmExportBuildFileGenerator -::ComplainAboutMissingTarget(cmTarget* depender, - cmTarget* dependee, +::ComplainAboutMissingTarget(cmGeneratorTarget* depender, + cmGeneratorTarget* dependee, int occurrences) { if(cmSystemTools::GetErrorOccuredFlag()) diff --git a/Source/cmExportBuildFileGenerator.h b/Source/cmExportBuildFileGenerator.h index c7d317f..85aae2f 100644 --- a/Source/cmExportBuildFileGenerator.h +++ b/Source/cmExportBuildFileGenerator.h @@ -54,11 +54,11 @@ protected: std::vector &missingTargets); virtual void HandleMissingTarget(std::string& link_libs, std::vector& missingTargets, - cmTarget* depender, - cmTarget* dependee); + cmGeneratorTarget* depender, + cmGeneratorTarget* dependee); - void ComplainAboutMissingTarget(cmTarget* depender, - cmTarget* dependee, + void ComplainAboutMissingTarget(cmGeneratorTarget* depender, + cmGeneratorTarget* dependee, int occurrences); /** Fill in properties indicating built file locations. */ diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 192a932..b597b53 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -661,7 +661,7 @@ cmExportFileGenerator::AddTargetNamespace(std::string &input, { std::string namespacedTarget; this->HandleMissingTarget(namespacedTarget, missingTargets, - target->Target, tgt->Target); + target, tgt); if (!namespacedTarget.empty()) { input = namespacedTarget; diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h index e1ff83d..be5c6f7 100644 --- a/Source/cmExportFileGenerator.h +++ b/Source/cmExportFileGenerator.h @@ -119,8 +119,8 @@ protected: * export set. */ virtual void HandleMissingTarget(std::string& link_libs, std::vector& missingTargets, - cmTarget* depender, - cmTarget* dependee) = 0; + cmGeneratorTarget* depender, + cmGeneratorTarget* dependee) = 0; void PopulateInterfaceProperty(const std::string&, cmGeneratorTarget *target, cmGeneratorExpression::PreprocessContext, diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index 48f92b0..988b0dc 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -453,19 +453,19 @@ cmExportInstallFileGenerator //---------------------------------------------------------------------------- void -cmExportInstallFileGenerator::HandleMissingTarget( - std::string& link_libs, std::vector& missingTargets, - cmTarget* depender, cmTarget* dependee) +cmExportInstallFileGenerator::HandleMissingTarget(std::string& link_libs, + std::vector& missingTargets, + cmGeneratorTarget* depender, cmGeneratorTarget* dependee) { const std::string name = dependee->GetName(); - cmGlobalGenerator* gg = dependee->GetMakefile()->GetGlobalGenerator(); + cmGlobalGenerator* gg = dependee->GetLocalGenerator()->GetGlobalGenerator(); std::vector namespaces = this->FindNamespaces(gg, name); int targetOccurrences = (int)namespaces.size(); if (targetOccurrences == 1) { std::string missingTarget = namespaces[0]; - missingTarget += dependee->GetExportName(); + missingTarget += dependee->Target->GetExportName(); link_libs += missingTarget; missingTargets.push_back(missingTarget); } @@ -520,8 +520,8 @@ cmExportInstallFileGenerator //---------------------------------------------------------------------------- void cmExportInstallFileGenerator -::ComplainAboutMissingTarget(cmTarget* depender, - cmTarget* dependee, +::ComplainAboutMissingTarget(cmGeneratorTarget* depender, + cmGeneratorTarget* dependee, int occurrences) { std::ostringstream e; diff --git a/Source/cmExportInstallFileGenerator.h b/Source/cmExportInstallFileGenerator.h index b1fa70e..13dae89 100644 --- a/Source/cmExportInstallFileGenerator.h +++ b/Source/cmExportInstallFileGenerator.h @@ -57,13 +57,13 @@ protected: std::vector &missingTargets); virtual void HandleMissingTarget(std::string& link_libs, std::vector& missingTargets, - cmTarget* depender, - cmTarget* dependee); + cmGeneratorTarget* depender, + cmGeneratorTarget* dependee); virtual void ReplaceInstallPrefix(std::string &input); - void ComplainAboutMissingTarget(cmTarget* depender, - cmTarget* dependee, + void ComplainAboutMissingTarget(cmGeneratorTarget* depender, + cmGeneratorTarget* dependee, int occurrences); std::vector FindNamespaces(cmGlobalGenerator* gg, diff --git a/Source/cmExportTryCompileFileGenerator.h b/Source/cmExportTryCompileFileGenerator.h index 50c3187..fc135a4 100644 --- a/Source/cmExportTryCompileFileGenerator.h +++ b/Source/cmExportTryCompileFileGenerator.h @@ -37,8 +37,8 @@ protected: std::vector&) {} virtual void HandleMissingTarget(std::string&, std::vector&, - cmTarget*, - cmTarget*) {} + cmGeneratorTarget*, + cmGeneratorTarget*) {} void PopulateProperties(cmGeneratorTarget const* target, ImportPropertyMap& properties, -- cgit v0.12