Export: Port internal utility to cmGeneratorTarget.
This commit is contained in:
parent
2b9cc1e248
commit
e666128243
|
@ -237,14 +237,15 @@ void
|
|||
cmExportBuildFileGenerator::HandleMissingTarget(
|
||||
std::string& link_libs,
|
||||
std::vector<std::string>& 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<std::string> 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())
|
||||
|
|
|
@ -54,11 +54,11 @@ protected:
|
|||
std::vector<std::string> &missingTargets);
|
||||
virtual void HandleMissingTarget(std::string& link_libs,
|
||||
std::vector<std::string>& 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. */
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -119,8 +119,8 @@ protected:
|
|||
* export set. */
|
||||
virtual void HandleMissingTarget(std::string& link_libs,
|
||||
std::vector<std::string>& missingTargets,
|
||||
cmTarget* depender,
|
||||
cmTarget* dependee) = 0;
|
||||
cmGeneratorTarget* depender,
|
||||
cmGeneratorTarget* dependee) = 0;
|
||||
void PopulateInterfaceProperty(const std::string&,
|
||||
cmGeneratorTarget *target,
|
||||
cmGeneratorExpression::PreprocessContext,
|
||||
|
|
|
@ -453,19 +453,19 @@ cmExportInstallFileGenerator
|
|||
|
||||
//----------------------------------------------------------------------------
|
||||
void
|
||||
cmExportInstallFileGenerator::HandleMissingTarget(
|
||||
std::string& link_libs, std::vector<std::string>& missingTargets,
|
||||
cmTarget* depender, cmTarget* dependee)
|
||||
cmExportInstallFileGenerator::HandleMissingTarget(std::string& link_libs,
|
||||
std::vector<std::string>& missingTargets,
|
||||
cmGeneratorTarget* depender, cmGeneratorTarget* dependee)
|
||||
{
|
||||
const std::string name = dependee->GetName();
|
||||
cmGlobalGenerator* gg = dependee->GetMakefile()->GetGlobalGenerator();
|
||||
cmGlobalGenerator* gg = dependee->GetLocalGenerator()->GetGlobalGenerator();
|
||||
std::vector<std::string> 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;
|
||||
|
|
|
@ -57,13 +57,13 @@ protected:
|
|||
std::vector<std::string> &missingTargets);
|
||||
virtual void HandleMissingTarget(std::string& link_libs,
|
||||
std::vector<std::string>& 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<std::string> FindNamespaces(cmGlobalGenerator* gg,
|
||||
|
|
|
@ -37,8 +37,8 @@ protected:
|
|||
std::vector<std::string>&) {}
|
||||
virtual void HandleMissingTarget(std::string&,
|
||||
std::vector<std::string>&,
|
||||
cmTarget*,
|
||||
cmTarget*) {}
|
||||
cmGeneratorTarget*,
|
||||
cmGeneratorTarget*) {}
|
||||
|
||||
void PopulateProperties(cmGeneratorTarget const* target,
|
||||
ImportPropertyMap& properties,
|
||||
|
|
Loading…
Reference in New Issue