summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkInformation.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2023-06-16 15:54:24 (GMT)
committerBrad King <brad.king@kitware.com>2023-06-23 16:07:18 (GMT)
commitd605f728f76b84e1e60000b9cb8704e5c1396763 (patch)
treed960480f98093f89f4fe13937997d2afa3430555 /Source/cmComputeLinkInformation.cxx
parentacc7e6a1445e584e21db57d167db3f0d7cae6257 (diff)
downloadCMake-d605f728f76b84e1e60000b9cb8704e5c1396763.zip
CMake-d605f728f76b84e1e60000b9cb8704e5c1396763.tar.gz
CMake-d605f728f76b84e1e60000b9cb8704e5c1396763.tar.bz2
macOS: Allow IMPORTED_LOCATION to be a framework folder
Issue: #24946
Diffstat (limited to 'Source/cmComputeLinkInformation.cxx')
-rw-r--r--Source/cmComputeLinkInformation.cxx31
1 files changed, 25 insertions, 6 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index b80b3cb..04e4fc7 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -1579,7 +1579,9 @@ void cmComputeLinkInformation::AddTargetItem(LinkEntry const& entry)
this->OldLinkDirItems.push_back(item.Value);
}
- if (target->IsFrameworkOnApple()) {
+ const bool isImportedFrameworkFolderOnApple =
+ target->IsImportedFrameworkFolderOnApple(this->Config);
+ if (target->IsFrameworkOnApple() || isImportedFrameworkFolderOnApple) {
// Add the framework directory and the framework item itself
auto fwDescriptor = this->GlobalGenerator->SplitFrameworkPath(
item.Value, cmGlobalGenerator::FrameworkFormat::Extended);
@@ -1597,16 +1599,33 @@ void cmComputeLinkInformation::AddTargetItem(LinkEntry const& entry)
}
if (this->GlobalGenerator->IsXcode()) {
- this->Items.emplace_back(
- item, ItemIsPath::Yes, target,
- this->FindLibraryFeature(entry.Feature == DEFAULT
- ? "__CMAKE_LINK_FRAMEWORK"
- : entry.Feature));
+ if (isImportedFrameworkFolderOnApple) {
+ if (entry.Feature == DEFAULT) {
+ this->AddLibraryFeature("FRAMEWORK");
+ this->Items.emplace_back(item, ItemIsPath::Yes, target,
+ this->FindLibraryFeature("FRAMEWORK"));
+ } else {
+ this->Items.emplace_back(item, ItemIsPath::Yes, target,
+ this->FindLibraryFeature(entry.Feature));
+ }
+ } else {
+ this->Items.emplace_back(
+ item, ItemIsPath::Yes, target,
+ this->FindLibraryFeature(entry.Feature == DEFAULT
+ ? "__CMAKE_LINK_FRAMEWORK"
+ : entry.Feature));
+ }
} else {
if (cmHasSuffix(entry.Feature, "FRAMEWORK"_s)) {
this->Items.emplace_back(fwDescriptor->GetLinkName(), ItemIsPath::Yes,
target,
this->FindLibraryFeature(entry.Feature));
+ } else if (entry.Feature == DEFAULT &&
+ isImportedFrameworkFolderOnApple) {
+ this->AddLibraryFeature("FRAMEWORK");
+ this->Items.emplace_back(fwDescriptor->GetLinkName(), ItemIsPath::Yes,
+ target,
+ this->FindLibraryFeature("FRAMEWORK"));
} else {
this->Items.emplace_back(
item, ItemIsPath::Yes, target,