summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2022-02-10 22:57:14 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2022-02-15 09:53:33 (GMT)
commita2cfa2da4f53a5e9c78e6cf7332c6a308ef38af2 (patch)
tree28ddbbd9f07ad92b87fbe439c2ead74041c74f44 /Source/cmGlobalGenerator.cxx
parent40178f3c908795a993148553a04be25748942efc (diff)
downloadCMake-a2cfa2da4f53a5e9c78e6cf7332c6a308ef38af2.zip
CMake-a2cfa2da4f53a5e9c78e6cf7332c6a308ef38af2.tar.gz
CMake-a2cfa2da4f53a5e9c78e6cf7332c6a308ef38af2.tar.bz2
GenEx/LINK_LIBRARY: Add features for framework support on Apple
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 79d637d..baa54e5 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2529,7 +2529,8 @@ bool cmGlobalGenerator::NameResolvesToFramework(
// .tbd files also can be located in SDK frameworks (they are
// placeholders for actual libraries shipped with the OS)
cm::optional<std::pair<std::string, std::string>>
-cmGlobalGenerator::SplitFrameworkPath(const std::string& path) const
+cmGlobalGenerator::SplitFrameworkPath(const std::string& path,
+ bool extendedFormat) const
{
// Check for framework structure:
// (/path/to/)?FwName.framework
@@ -2550,6 +2551,16 @@ cmGlobalGenerator::SplitFrameworkPath(const std::string& path) const
return std::pair<std::string, std::string>{ frameworkPath.match(2), name };
}
+ if (extendedFormat) {
+ // path format can be more flexible: (/path/to/)?fwName(.framework)?
+ auto fwDir = cmSystemTools::GetParentDirectory(path);
+ auto name = cmSystemTools::GetFilenameLastExtension(path) == ".framework"
+ ? cmSystemTools::GetFilenameWithoutExtension(path)
+ : cmSystemTools::GetFilenameName(path);
+
+ return std::pair<std::string, std::string>{ fwDir, name };
+ }
+
return cm::nullopt;
}