diff options
author | Brad King <brad.king@kitware.com> | 2018-02-28 15:58:07 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-02-28 15:58:10 (GMT) |
commit | ea0ce73a195e1cc0f672f1e7519c42a240592f15 (patch) | |
tree | 568319f21bf3e9ed2583832c0b2e69eb2d29d5b3 /Source/cmExportFileGenerator.cxx | |
parent | d870148537319da2e86237cbd8baf6815975e594 (diff) | |
download | CMake-ea0ce73a195e1cc0f672f1e7519c42a240592f15.zip CMake-ea0ce73a195e1cc0f672f1e7519c42a240592f15.tar.gz CMake-ea0ce73a195e1cc0f672f1e7519c42a240592f15.tar.bz2 |
install,export: Maybe transform OBJECT libraries to INTERFACE libraries
Teach the `install` and `export` commands to support installing and
exporting `OBJECT` libraries without their object files. Transform
them to `INTERFACE` libraries in such cases.
For `install(TARGETS)`, activate this when no destination for the object
files is specified. For `export`, activate this only under Xcode with
multiple architectures when we have no well-defined object file
locations to give to clients.
Diffstat (limited to 'Source/cmExportFileGenerator.cxx')
-rw-r--r-- | Source/cmExportFileGenerator.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 434abdc..0f1d745 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -901,8 +901,10 @@ void cmExportFileGenerator::GenerateExpectedTargetsCode( "\n\n"; /* clang-format on */ } + void cmExportFileGenerator::GenerateImportTargetCode( - std::ostream& os, const cmGeneratorTarget* target) + std::ostream& os, cmGeneratorTarget const* target, + cmStateEnums::TargetType targetType) { // Construct the imported target name. std::string targetName = this->Namespace; @@ -911,7 +913,7 @@ void cmExportFileGenerator::GenerateImportTargetCode( // Create the imported target. os << "# Create imported target " << targetName << "\n"; - switch (target->GetType()) { + switch (targetType) { case cmStateEnums::EXECUTABLE: os << "add_executable(" << targetName << " IMPORTED)\n"; break; |