summaryrefslogtreecommitdiffstats
path: root/Source/cmExportFileGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-10-17 12:33:51 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-10-18 14:29:29 (GMT)
commit6a72b3c84e016d7e540aa3d9b079200b3fb52ab7 (patch)
tree3eb9c8d9adf1370fb6371ab4ff54aad4c423c4f7 /Source/cmExportFileGenerator.cxx
parent1293c1561a58b2f8b0bd4ec05bb249fc36f487ac (diff)
downloadCMake-6a72b3c84e016d7e540aa3d9b079200b3fb52ab7.zip
CMake-6a72b3c84e016d7e540aa3d9b079200b3fb52ab7.tar.gz
CMake-6a72b3c84e016d7e540aa3d9b079200b3fb52ab7.tar.bz2
Export: Port interface to cmGeneratorTarget.
Diffstat (limited to 'Source/cmExportFileGenerator.cxx')
-rw-r--r--Source/cmExportFileGenerator.cxx69
1 files changed, 34 insertions, 35 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 4e8bc86..0985542 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -155,7 +155,7 @@ void cmExportFileGenerator::GenerateImportConfig(std::ostream& os,
//----------------------------------------------------------------------------
void cmExportFileGenerator::PopulateInterfaceProperty(
const std::string& propName,
- cmTarget *target,
+ cmGeneratorTarget *target,
ImportPropertyMap &properties)
{
const char *input = target->GetProperty(propName);
@@ -169,7 +169,7 @@ void cmExportFileGenerator::PopulateInterfaceProperty(
void cmExportFileGenerator::PopulateInterfaceProperty(
const std::string& propName,
const std::string& outputName,
- cmTarget *target,
+ cmGeneratorTarget *target,
cmGeneratorExpression::PreprocessContext preprocessRule,
ImportPropertyMap &properties,
std::vector<std::string> &missingTargets)
@@ -206,12 +206,12 @@ void cmExportFileGenerator::GenerateRequiredCMakeVersion(std::ostream& os,
//----------------------------------------------------------------------------
bool cmExportFileGenerator::PopulateInterfaceLinkLibrariesProperty(
- cmTarget *target,
+ cmGeneratorTarget *target,
cmGeneratorExpression::PreprocessContext preprocessRule,
ImportPropertyMap &properties,
std::vector<std::string> &missingTargets)
{
- if(!target->IsLinkable())
+ if(!target->Target->IsLinkable())
{
return false;
}
@@ -420,7 +420,7 @@ void cmExportFileGenerator::PopulateSourcesInterface(
true);
if (!prepro.empty())
{
- this->ResolveTargetsInGeneratorExpressions(prepro, gt->Target,
+ this->ResolveTargetsInGeneratorExpressions(prepro, gt,
missingTargets);
if (!checkInterfaceDirs(prepro, gt, propName))
@@ -488,7 +488,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
true);
if (!prepro.empty())
{
- this->ResolveTargetsInGeneratorExpressions(prepro, target->Target,
+ this->ResolveTargetsInGeneratorExpressions(prepro, target,
missingTargets);
if (!checkInterfaceDirs(prepro, target, propName))
@@ -502,7 +502,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
//----------------------------------------------------------------------------
void cmExportFileGenerator::PopulateInterfaceProperty(
const std::string& propName,
- cmTarget *target,
+ cmGeneratorTarget* target,
cmGeneratorExpression::PreprocessContext preprocessRule,
ImportPropertyMap &properties,
std::vector<std::string> &missingTargets)
@@ -574,15 +574,14 @@ void cmExportFileGenerator::PopulateCompatibleInterfaceProperties(
cmGeneratorTarget *gtarget,
ImportPropertyMap &properties)
{
- cmTarget *target = gtarget->Target;
this->PopulateInterfaceProperty("COMPATIBLE_INTERFACE_BOOL",
- target, properties);
+ gtarget, properties);
this->PopulateInterfaceProperty("COMPATIBLE_INTERFACE_STRING",
- target, properties);
+ gtarget, properties);
this->PopulateInterfaceProperty("COMPATIBLE_INTERFACE_NUMBER_MIN",
- target, properties);
+ gtarget, properties);
this->PopulateInterfaceProperty("COMPATIBLE_INTERFACE_NUMBER_MAX",
- target, properties);
+ gtarget, properties);
std::set<std::string> ifaceProperties;
@@ -593,12 +592,12 @@ void cmExportFileGenerator::PopulateCompatibleInterfaceProperties(
getPropertyContents(gtarget, "COMPATIBLE_INTERFACE_NUMBER_MAX",
ifaceProperties);
- if (target->GetType() != cmState::INTERFACE_LIBRARY)
+ if (gtarget->GetType() != cmState::INTERFACE_LIBRARY)
{
getCompatibleInterfaceProperties(gtarget, ifaceProperties, "");
std::vector<std::string> configNames;
- target->GetMakefile()->GetConfigurations(configNames);
+ gtarget->Target->GetMakefile()->GetConfigurations(configNames);
for (std::vector<std::string>::const_iterator ci = configNames.begin();
ci != configNames.end(); ++ci)
@@ -611,19 +610,20 @@ void cmExportFileGenerator::PopulateCompatibleInterfaceProperties(
it != ifaceProperties.end(); ++it)
{
this->PopulateInterfaceProperty("INTERFACE_" + *it,
- target, properties);
+ gtarget, properties);
}
}
//----------------------------------------------------------------------------
-void cmExportFileGenerator::GenerateInterfaceProperties(cmTarget const* target,
+void cmExportFileGenerator::GenerateInterfaceProperties(
+ const cmGeneratorTarget* target,
std::ostream& os,
const ImportPropertyMap &properties)
{
if (!properties.empty())
{
std::string targetName = this->Namespace;
- targetName += target->GetExportName();
+ targetName += target->Target->GetExportName();
os << "set_target_properties(" << targetName << " PROPERTIES\n";
for(ImportPropertyMap::const_iterator pi = properties.begin();
pi != properties.end(); ++pi)
@@ -638,12 +638,12 @@ void cmExportFileGenerator::GenerateInterfaceProperties(cmTarget const* target,
//----------------------------------------------------------------------------
bool
cmExportFileGenerator::AddTargetNamespace(std::string &input,
- cmTarget* target,
+ cmGeneratorTarget* target,
std::vector<std::string> &missingTargets)
{
- cmMakefile *mf = target->GetMakefile();
+ cmLocalGenerator *lg = target->GetLocalGenerator();
- cmTarget *tgt = mf->FindTargetToUse(input);
+ cmGeneratorTarget *tgt = lg->FindGeneratorTargetToUse(input);
if (!tgt)
{
return false;
@@ -655,13 +655,14 @@ cmExportFileGenerator::AddTargetNamespace(std::string &input,
}
if(this->ExportedTargets.find(tgt) != this->ExportedTargets.end())
{
- input = this->Namespace + tgt->GetExportName();
+ input = this->Namespace + tgt->Target->GetExportName();
}
else
{
std::string namespacedTarget;
this->HandleMissingTarget(namespacedTarget, missingTargets,
- mf, target, tgt);
+ target->Target->GetMakefile(),
+ target->Target, tgt->Target);
if (!namespacedTarget.empty())
{
input = namespacedTarget;
@@ -674,7 +675,7 @@ cmExportFileGenerator::AddTargetNamespace(std::string &input,
void
cmExportFileGenerator::ResolveTargetsInGeneratorExpressions(
std::string &input,
- cmTarget* target,
+ cmGeneratorTarget* target,
std::vector<std::string> &missingTargets,
FreeTargetsReplace replace)
{
@@ -711,14 +712,12 @@ cmExportFileGenerator::ResolveTargetsInGeneratorExpressions(
void
cmExportFileGenerator::ResolveTargetsInGeneratorExpression(
std::string &input,
- cmTarget* target,
+ cmGeneratorTarget* target,
std::vector<std::string> &missingTargets)
{
std::string::size_type pos = 0;
std::string::size_type lastPos = pos;
- cmMakefile *mf = target->GetMakefile();
-
while((pos = input.find("$<TARGET_PROPERTY:", lastPos)) != input.npos)
{
std::string::size_type nameStartPos = pos +
@@ -779,7 +778,7 @@ cmExportFileGenerator::ResolveTargetsInGeneratorExpression(
if (!errorString.empty())
{
- mf->IssueMessage(cmake::FATAL_ERROR, errorString);
+ target->GetLocalGenerator()->IssueMessage(cmake::FATAL_ERROR, errorString);
}
}
@@ -860,7 +859,7 @@ cmExportFileGenerator
preprocessRule);
if (!prepro.empty())
{
- this->ResolveTargetsInGeneratorExpressions(prepro, target->Target,
+ this->ResolveTargetsInGeneratorExpressions(prepro, target,
missingTargets,
ReplaceFreeTargets);
properties["IMPORTED_LINK_INTERFACE_LIBRARIES" + suffix] = prepro;
@@ -962,7 +961,7 @@ cmExportFileGenerator
sep = ";";
std::string temp = *li;
- this->AddTargetNamespace(temp, target->Target, missingTargets);
+ this->AddTargetNamespace(temp, target, missingTargets);
link_entries += temp;
}
@@ -1044,12 +1043,12 @@ void cmExportFileGenerator::GenerateExpectedTargetsCode(std::ostream& os,
//----------------------------------------------------------------------------
void
cmExportFileGenerator
-::GenerateImportTargetCode(std::ostream& os, cmTarget const* target)
+::GenerateImportTargetCode(std::ostream& os, const cmGeneratorTarget* target)
{
// Construct the imported target name.
std::string targetName = this->Namespace;
- targetName += target->GetExportName();
+ targetName += target->Target->GetExportName();
// Create the imported target.
os << "# Create imported target " << targetName << "\n";
@@ -1078,27 +1077,27 @@ cmExportFileGenerator
}
// Mark the imported executable if it has exports.
- if(target->IsExecutableWithExports())
+ if(target->Target->IsExecutableWithExports())
{
os << "set_property(TARGET " << targetName
<< " PROPERTY ENABLE_EXPORTS 1)\n";
}
// Mark the imported library if it is a framework.
- if(target->IsFrameworkOnApple())
+ if(target->Target->IsFrameworkOnApple())
{
os << "set_property(TARGET " << targetName
<< " PROPERTY FRAMEWORK 1)\n";
}
// Mark the imported executable if it is an application bundle.
- if(target->IsAppBundleOnApple())
+ if(target->Target->IsAppBundleOnApple())
{
os << "set_property(TARGET " << targetName
<< " PROPERTY MACOSX_BUNDLE 1)\n";
}
- if (target->IsCFBundleOnApple())
+ if (target->Target->IsCFBundleOnApple())
{
os << "set_property(TARGET " << targetName
<< " PROPERTY BUNDLE 1)\n";