diff options
author | Stephen Kelly <steveire@gmail.com> | 2012-11-20 10:06:29 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-10-08 00:07:27 (GMT) |
commit | ce0c303d62941d2b10098b1ec00de3ced8556919 (patch) | |
tree | 46e32f12cb91c4172aebf3fe7004640382644408 /Source | |
parent | 435c912848b08333e03c74439f725c9b96890d80 (diff) | |
download | CMake-ce0c303d62941d2b10098b1ec00de3ced8556919.zip CMake-ce0c303d62941d2b10098b1ec00de3ced8556919.tar.gz CMake-ce0c303d62941d2b10098b1ec00de3ced8556919.tar.bz2 |
install: Teach EXPORT option to handle INTERFACE_LIBRARY targets
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmExportInstallFileGenerator.cxx | 19 | ||||
-rw-r--r-- | Source/cmInstallCommand.cxx | 8 |
2 files changed, 25 insertions, 2 deletions
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index c8b4a79..c71008e 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -114,6 +114,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os) std::vector<std::string> missingTargets; bool require2_8_12 = false; + bool require2_8_13 = false; // Create all the imported targets. for(std::vector<cmTargetExport*>::const_iterator tei = allTargets.begin(); @@ -153,6 +154,10 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os) require2_8_12 = true; } } + if (te->GetType() == cmTarget::INTERFACE_LIBRARY) + { + require2_8_13 = true; + } this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE", te, properties); this->PopulateCompatibleInterfaceProperties(te, properties); @@ -160,7 +165,11 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os) this->GenerateInterfaceProperties(te, os, properties); } - if (require2_8_12) + if (require2_8_13) + { + this->GenerateRequiredCMakeVersion(os, "2.8.12.20131007"); + } + else if (require2_8_12) { this->GenerateRequiredCMakeVersion(os, "2.8.12"); } @@ -286,6 +295,14 @@ cmExportInstallFileGenerator cmTargetExport const* te = *tei; ImportPropertyMap properties; std::set<std::string> importedLocations; + if (!properties.empty() + && te->Target->GetType() == cmTarget::INTERFACE_LIBRARY) + { + this->GenerateImportPropertyCode(os, config, te->Target, properties); + this->GenerateImportedFileChecksCode(os, te->Target, properties, + importedLocations); + continue; + } this->SetImportLocationProperty(config, suffix, te->ArchiveGenerator, properties, importedLocations); this->SetImportLocationProperty(config, suffix, te->LibraryGenerator, diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index 3c76bd6..d309a2a 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -379,7 +379,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) target->GetType() != cmTarget::STATIC_LIBRARY && target->GetType() != cmTarget::SHARED_LIBRARY && target->GetType() != cmTarget::MODULE_LIBRARY && - target->GetType() != cmTarget::OBJECT_LIBRARY) + target->GetType() != cmTarget::OBJECT_LIBRARY && + target->GetType() != cmTarget::INTERFACE_LIBRARY) { cmOStringStream e; e << "TARGETS given target \"" << (*targetIt) @@ -626,6 +627,11 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) } } break; + case cmTarget::INTERFACE_LIBRARY: + // Nothing to do. An INTERFACE_LIBRARY can be installed, but the + // only effect of that is to make it exportable. It installs no + // other files itself. + break; default: // This should never happen due to the above type check. // Ignore the case. |