summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx22
1 files changed, 8 insertions, 14 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 32f0cbd..f8455c8 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -59,8 +59,6 @@
namespace {
using LinkInterfaceFor = cmGeneratorTarget::LinkInterfaceFor;
-const cmsys::RegularExpression FrameworkRegularExpression(
- "^(.*/)?([^/]*)\\.framework/(.*)$");
const std::string kINTERFACE_LINK_LIBRARIES = "INTERFACE_LINK_LIBRARIES";
const std::string kINTERFACE_LINK_LIBRARIES_DIRECT =
"INTERFACE_LINK_LIBRARIES_DIRECT";
@@ -2434,11 +2432,10 @@ std::string cmGeneratorTarget::GetSOName(
}
// Use the soname given if any.
if (this->IsFrameworkOnApple()) {
- cmsys::RegularExpressionMatch match;
- if (FrameworkRegularExpression.find(info->SOName.c_str(), match)) {
- auto frameworkName = match.match(2);
- auto fileName = match.match(3);
- return cmStrCat(frameworkName, ".framework/", fileName);
+ auto fwDescriptor = this->GetGlobalGenerator()->SplitFrameworkPath(
+ info->SOName, cmGlobalGenerator::FrameworkFormat::Strict);
+ if (fwDescriptor) {
+ return fwDescriptor->GetVersionedName();
}
}
if (cmHasLiteralPrefix(info->SOName, "@rpath/")) {
@@ -7036,13 +7033,10 @@ std::string cmGeneratorTarget::GetDirectory(
if (this->IsImported()) {
auto fullPath = this->Target->ImportedGetFullPath(config, artifact);
if (this->IsFrameworkOnApple()) {
- cmsys::RegularExpressionMatch match;
- if (FrameworkRegularExpression.find(fullPath.c_str(), match)) {
- auto path = match.match(1);
- if (!path.empty()) {
- path.erase(path.length() - 1);
- }
- return path;
+ auto fwDescriptor = this->GetGlobalGenerator()->SplitFrameworkPath(
+ fullPath, cmGlobalGenerator::FrameworkFormat::Strict);
+ if (fwDescriptor) {
+ return fwDescriptor->Directory;
}
}
// Return the directory from which the target is imported.