summaryrefslogtreecommitdiffstats
path: root/Source/cmExportInstallFileGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-11-28 17:58:38 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-02-10 23:51:34 (GMT)
commit6da65b3907419df28484c570f24d0da3593a0e5a (patch)
treeae814193dd7306ad6aa369dca4d489f9f8f6eaf9 /Source/cmExportInstallFileGenerator.cxx
parent736bcb9664b714b91e8a2a573451e0453716f4da (diff)
downloadCMake-6da65b3907419df28484c570f24d0da3593a0e5a.zip
CMake-6da65b3907419df28484c570f24d0da3593a0e5a.tar.gz
CMake-6da65b3907419df28484c570f24d0da3593a0e5a.tar.bz2
Allow export of targets with INTERFACE_SOURCES.
Use the same rules for paths in source and binary dirs in installed INTERFACE_SOURCES as are used for INTERFACE_INCLUDE_DIRECTORIES.
Diffstat (limited to 'Source/cmExportInstallFileGenerator.cxx')
-rw-r--r--Source/cmExportInstallFileGenerator.cxx28
1 files changed, 16 insertions, 12 deletions
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 98ed818..a0d9013 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -123,6 +123,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
bool require2_8_12 = false;
bool require3_0_0 = false;
+ bool require3_1_0 = false;
bool requiresConfigFiles = false;
// Create all the imported targets.
for(std::vector<cmTargetExport*>::const_iterator
@@ -131,17 +132,6 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
{
cmTarget* te = (*tei)->Target;
- if (te->GetProperty("INTERFACE_SOURCES"))
- {
- std::ostringstream e;
- e << "Target \""
- << te->GetName()
- << "\" has a populated INTERFACE_SOURCES property. This is not "
- "currently supported.";
- cmSystemTools::Error(e.str().c_str());
- return false;
- }
-
requiresConfigFiles = requiresConfigFiles
|| te->GetType() != cmTarget::INTERFACE_LIBRARY;
@@ -152,6 +142,9 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
this->PopulateIncludeDirectoriesInterface(*tei,
cmGeneratorExpression::InstallInterface,
properties, missingTargets);
+ this->PopulateSourcesInterface(*tei,
+ cmGeneratorExpression::InstallInterface,
+ properties, missingTargets);
this->PopulateInterfaceProperty("INTERFACE_SYSTEM_INCLUDE_DIRECTORIES",
te,
cmGeneratorExpression::InstallInterface,
@@ -190,6 +183,13 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
{
require3_0_0 = true;
}
+ if(te->GetProperty("INTERFACE_SOURCES"))
+ {
+ // We can only generate INTERFACE_SOURCES in CMake 3.3, but CMake 3.1
+ // can consume them.
+ require3_1_0 = true;
+ }
+
this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE",
te, properties);
this->PopulateCompatibleInterfaceProperties(te, properties);
@@ -197,7 +197,11 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
this->GenerateInterfaceProperties(te, os, properties);
}
- if (require3_0_0)
+ if (require3_1_0)
+ {
+ this->GenerateRequiredCMakeVersion(os, "3.1.0");
+ }
+ else if (require3_0_0)
{
this->GenerateRequiredCMakeVersion(os, "3.0.0");
}