summaryrefslogtreecommitdiffstats
path: root/Source/cmExportFileGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmExportFileGenerator.cxx')
-rw-r--r--Source/cmExportFileGenerator.cxx45
1 files changed, 36 insertions, 9 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index ef336ea..03e8dff 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -52,6 +52,12 @@ void cmExportFileGenerator::SetExportFile(const char* mainFile)
}
//----------------------------------------------------------------------------
+const char* cmExportFileGenerator::GetMainExportFileName() const
+{
+ return this->MainImportFile.c_str();
+}
+
+//----------------------------------------------------------------------------
bool cmExportFileGenerator::GenerateImportFile()
{
// Open the output file to generate it.
@@ -378,11 +384,14 @@ void getCompatibleInterfaceProperties(cmTarget *target,
if (!info)
{
- cmMakefile* mf = target->GetMakefile();
- cmOStringStream e;
- e << "Exporting the target \"" << target->GetName() << "\" is not "
- "allowed since its linker language cannot be determined";
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ if (target->GetType() != cmTarget::INTERFACE_LIBRARY)
+ {
+ cmMakefile* mf = target->GetMakefile();
+ cmOStringStream e;
+ e << "Exporting the target \"" << target->GetName() << "\" is not "
+ "allowed since its linker language cannot be determined";
+ mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ }
return;
}
@@ -402,6 +411,12 @@ void getCompatibleInterfaceProperties(cmTarget *target,
getPropertyContents(li->Target,
"COMPATIBLE_INTERFACE_STRING",
ifaceProperties);
+ getPropertyContents(li->Target,
+ "COMPATIBLE_INTERFACE_NUMBER_MIN",
+ ifaceProperties);
+ getPropertyContents(li->Target,
+ "COMPATIBLE_INTERFACE_NUMBER_MAX",
+ ifaceProperties);
}
}
@@ -414,11 +429,19 @@ void cmExportFileGenerator::PopulateCompatibleInterfaceProperties(
target, properties);
this->PopulateInterfaceProperty("COMPATIBLE_INTERFACE_STRING",
target, properties);
+ this->PopulateInterfaceProperty("COMPATIBLE_INTERFACE_NUMBER_MIN",
+ target, properties);
+ this->PopulateInterfaceProperty("COMPATIBLE_INTERFACE_NUMBER_MAX",
+ target, properties);
std::set<std::string> ifaceProperties;
getPropertyContents(target, "COMPATIBLE_INTERFACE_BOOL", ifaceProperties);
getPropertyContents(target, "COMPATIBLE_INTERFACE_STRING", ifaceProperties);
+ getPropertyContents(target, "COMPATIBLE_INTERFACE_NUMBER_MIN",
+ ifaceProperties);
+ getPropertyContents(target, "COMPATIBLE_INTERFACE_NUMBER_MAX",
+ ifaceProperties);
getCompatibleInterfaceProperties(target, ifaceProperties, 0);
@@ -440,7 +463,7 @@ void cmExportFileGenerator::PopulateCompatibleInterfaceProperties(
}
//----------------------------------------------------------------------------
-void cmExportFileGenerator::GenerateInterfaceProperties(cmTarget *target,
+void cmExportFileGenerator::GenerateInterfaceProperties(cmTarget const* target,
std::ostream& os,
const ImportPropertyMap &properties)
{
@@ -736,9 +759,10 @@ cmExportFileGenerator
"IMPORTED_LINK_INTERFACE_LANGUAGES",
iface->Languages, properties, missingTargets);
+ std::vector<std::string> dummy;
this->SetImportLinkProperty(suffix, target,
"IMPORTED_LINK_DEPENDENT_LIBRARIES",
- iface->SharedDeps, properties, missingTargets);
+ iface->SharedDeps, properties, dummy);
if(iface->Multiplicity > 0)
{
std::string prop = "IMPORTED_LINK_INTERFACE_MULTIPLICITY";
@@ -861,7 +885,7 @@ void cmExportFileGenerator::GenerateExpectedTargetsCode(std::ostream& os,
//----------------------------------------------------------------------------
void
cmExportFileGenerator
-::GenerateImportTargetCode(std::ostream& os, cmTarget* target)
+::GenerateImportTargetCode(std::ostream& os, cmTarget const* target)
{
// Construct the imported target name.
std::string targetName = this->Namespace;
@@ -887,6 +911,9 @@ cmExportFileGenerator
case cmTarget::UNKNOWN_LIBRARY:
os << "add_library(" << targetName << " UNKNOWN IMPORTED)\n";
break;
+ case cmTarget::INTERFACE_LIBRARY:
+ os << "add_library(" << targetName << " INTERFACE IMPORTED)\n";
+ break;
default: // should never happen
break;
}
@@ -924,7 +951,7 @@ cmExportFileGenerator
void
cmExportFileGenerator
::GenerateImportPropertyCode(std::ostream& os, const char* config,
- cmTarget* target,
+ cmTarget const* target,
ImportPropertyMap const& properties)
{
// Construct the imported target name.