cmGeneratorTarget: Move GetExportName from cmTarget.
This commit is contained in:
parent
d231c31b98
commit
eb3be7d688
|
@ -48,7 +48,7 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
|
|||
{
|
||||
cmGeneratorTarget *te = this->LG
|
||||
->FindGeneratorTargetToUse(*tei);
|
||||
expectedTargets += sep + this->Namespace + te->Target->GetExportName();
|
||||
expectedTargets += sep + this->Namespace + te->GetExportName();
|
||||
sep = " ";
|
||||
if(this->ExportedTargets.insert(te).second)
|
||||
{
|
||||
|
@ -253,7 +253,7 @@ cmExportBuildFileGenerator::HandleMissingTarget(
|
|||
{
|
||||
std::string missingTarget = namespaces[0];
|
||||
|
||||
missingTarget += dependee->Target->GetExportName();
|
||||
missingTarget += dependee->GetExportName();
|
||||
link_libs += missingTarget;
|
||||
missingTargets.push_back(missingTarget);
|
||||
return;
|
||||
|
@ -268,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->Target->GetExportName();
|
||||
link_libs += dependee->GetExportName();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include "cmLocalGenerator.h"
|
||||
#include "cmMakefile.h"
|
||||
#include "cmSystemTools.h"
|
||||
#include "cmTarget.h"
|
||||
#include "cmTargetExport.h"
|
||||
#include "cmVersion.h"
|
||||
#include "cmComputeLinkInformation.h"
|
||||
|
@ -623,7 +622,7 @@ void cmExportFileGenerator::GenerateInterfaceProperties(
|
|||
if (!properties.empty())
|
||||
{
|
||||
std::string targetName = this->Namespace;
|
||||
targetName += target->Target->GetExportName();
|
||||
targetName += target->GetExportName();
|
||||
os << "set_target_properties(" << targetName << " PROPERTIES\n";
|
||||
for(ImportPropertyMap::const_iterator pi = properties.begin();
|
||||
pi != properties.end(); ++pi)
|
||||
|
@ -655,7 +654,7 @@ cmExportFileGenerator::AddTargetNamespace(std::string &input,
|
|||
}
|
||||
if(this->ExportedTargets.find(tgt) != this->ExportedTargets.end())
|
||||
{
|
||||
input = this->Namespace + tgt->Target->GetExportName();
|
||||
input = this->Namespace + tgt->GetExportName();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1047,7 +1046,7 @@ cmExportFileGenerator
|
|||
// Construct the imported target name.
|
||||
std::string targetName = this->Namespace;
|
||||
|
||||
targetName += target->Target->GetExportName();
|
||||
targetName += target->GetExportName();
|
||||
|
||||
// Create the imported target.
|
||||
os << "# Create imported target " << targetName << "\n";
|
||||
|
@ -1114,7 +1113,7 @@ cmExportFileGenerator
|
|||
// Construct the imported target name.
|
||||
std::string targetName = this->Namespace;
|
||||
|
||||
targetName += target->Target->GetExportName();
|
||||
targetName += target->GetExportName();
|
||||
|
||||
// Set the import properties.
|
||||
os << "# Import target \"" << targetName << "\" for configuration \""
|
||||
|
@ -1234,7 +1233,7 @@ cmExportFileGenerator
|
|||
{
|
||||
// Construct the imported target name.
|
||||
std::string targetName = this->Namespace;
|
||||
targetName += target->Target->GetExportName();
|
||||
targetName += target->GetExportName();
|
||||
|
||||
os << "list(APPEND _IMPORT_CHECK_TARGETS " << targetName << " )\n"
|
||||
"list(APPEND _IMPORT_CHECK_FILES_FOR_" << targetName << " ";
|
||||
|
|
|
@ -49,7 +49,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
|
|||
tei != this->IEGen->GetExportSet()->GetTargetExports()->end(); ++tei)
|
||||
{
|
||||
expectedTargets +=
|
||||
sep + this->Namespace + (*tei)->Target->Target->GetExportName();
|
||||
sep + this->Namespace + (*tei)->Target->GetExportName();
|
||||
sep = " ";
|
||||
cmTargetExport * te = *tei;
|
||||
if(this->ExportedTargets.insert(te->Target).second)
|
||||
|
@ -465,7 +465,7 @@ cmExportInstallFileGenerator::HandleMissingTarget(std::string& link_libs,
|
|||
{
|
||||
std::string missingTarget = namespaces[0];
|
||||
|
||||
missingTarget += dependee->Target->GetExportName();
|
||||
missingTarget += dependee->GetExportName();
|
||||
link_libs += missingTarget;
|
||||
missingTargets.push_back(missingTarget);
|
||||
}
|
||||
|
|
|
@ -334,6 +334,26 @@ std::string cmGeneratorTarget::GetName() const
|
|||
return this->Target->GetName();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
std::string cmGeneratorTarget::GetExportName() const
|
||||
{
|
||||
const char *exportName = this->GetProperty("EXPORT_NAME");
|
||||
|
||||
if (exportName && *exportName)
|
||||
{
|
||||
if (!cmGeneratorExpression::IsValidTargetName(exportName))
|
||||
{
|
||||
std::ostringstream e;
|
||||
e << "EXPORT_NAME property \"" << exportName << "\" for \""
|
||||
<< this->GetName() << "\": is not valid.";
|
||||
cmSystemTools::Error(e.str().c_str());
|
||||
return "";
|
||||
}
|
||||
return exportName;
|
||||
}
|
||||
return this->GetName();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
const char *cmGeneratorTarget::GetProperty(const std::string& prop) const
|
||||
{
|
||||
|
|
|
@ -43,6 +43,8 @@ public:
|
|||
|
||||
cmState::TargetType GetType() const;
|
||||
std::string GetName() const;
|
||||
std::string GetExportName() const;
|
||||
|
||||
const char *GetProperty(const std::string& prop) const;
|
||||
bool GetPropertyAsBool(const std::string& prop) const;
|
||||
void GetSourceFiles(std::vector<cmSourceFile*>& files,
|
||||
|
|
|
@ -1411,26 +1411,6 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
|
|||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
std::string cmTarget::GetExportName() const
|
||||
{
|
||||
const char *exportName = this->GetProperty("EXPORT_NAME");
|
||||
|
||||
if (exportName && *exportName)
|
||||
{
|
||||
if (!cmGeneratorExpression::IsValidTargetName(exportName))
|
||||
{
|
||||
std::ostringstream e;
|
||||
e << "EXPORT_NAME property \"" << exportName << "\" for \""
|
||||
<< this->GetName() << "\": is not valid.";
|
||||
cmSystemTools::Error(e.str().c_str());
|
||||
return "";
|
||||
}
|
||||
return exportName;
|
||||
}
|
||||
return this->GetName();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void cmTarget::AppendBuildInterfaceIncludes()
|
||||
{
|
||||
|
|
|
@ -96,7 +96,6 @@ public:
|
|||
|
||||
///! Set/Get the name of the target
|
||||
const std::string& GetName() const {return this->Name;}
|
||||
std::string GetExportName() const;
|
||||
|
||||
///! Set the cmMakefile that owns this target
|
||||
void SetMakefile(cmMakefile *mf);
|
||||
|
|
Loading…
Reference in New Issue