diff options
author | Gregor Jasny <gjasny@googlemail.com> | 2016-12-26 17:07:24 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-01-31 13:59:15 (GMT) |
commit | 071f8e78dda152d8759539fa390b25c7f58d3cc5 (patch) | |
tree | 0f9e71cbe2e9556d44079a4311f53ec343bf3236 /Source/cmInstallCommand.cxx | |
parent | d525754eabef7a9f6e6696ae323a8ed965e12f2e (diff) | |
download | CMake-071f8e78dda152d8759539fa390b25c7f58d3cc5.zip CMake-071f8e78dda152d8759539fa390b25c7f58d3cc5.tar.gz CMake-071f8e78dda152d8759539fa390b25c7f58d3cc5.tar.bz2 |
Apple: Add support for static frameworks
Closes: #16432
Diffstat (limited to 'Source/cmInstallCommand.cxx')
-rw-r--r-- | Source/cmInstallCommand.cxx | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index fadebb4..4c331c7 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -471,17 +471,39 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) } } break; case cmStateEnums::STATIC_LIBRARY: { - // Static libraries use ARCHIVE properties. - if (!archiveArgs.GetDestination().empty()) { - archiveGenerator = - CreateInstallTargetGenerator(target, archiveArgs, false); + // If it is marked with FRAMEWORK property use the FRAMEWORK set of + // INSTALL properties. Otherwise, use the LIBRARY properties. + if (target.IsFrameworkOnApple()) { + // When in namelink only mode skip frameworks. + if (namelinkMode == cmInstallTargetGenerator::NamelinkModeOnly) { + continue; + } + + // Use the FRAMEWORK properties. + if (!frameworkArgs.GetDestination().empty()) { + frameworkGenerator = + CreateInstallTargetGenerator(target, frameworkArgs, false); + } else { + std::ostringstream e; + e << "TARGETS given no FRAMEWORK DESTINATION for static library " + "FRAMEWORK target \"" + << target.GetName() << "\"."; + this->SetError(e.str()); + return false; + } } else { - std::ostringstream e; - e << "TARGETS given no ARCHIVE DESTINATION for static library " - "target \"" - << target.GetName() << "\"."; - this->SetError(e.str()); - return false; + // Static libraries use ARCHIVE properties. + if (!archiveArgs.GetDestination().empty()) { + archiveGenerator = + CreateInstallTargetGenerator(target, archiveArgs, false); + } else { + std::ostringstream e; + e << "TARGETS given no ARCHIVE DESTINATION for static library " + "target \"" + << target.GetName() << "\"."; + this->SetError(e.str()); + return false; + } } } break; case cmStateEnums::MODULE_LIBRARY: { |