diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2022-02-10 22:57:14 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2022-02-15 09:53:33 (GMT) |
commit | a2cfa2da4f53a5e9c78e6cf7332c6a308ef38af2 (patch) | |
tree | 28ddbbd9f07ad92b87fbe439c2ead74041c74f44 /Source/cmGlobalGenerator.cxx | |
parent | 40178f3c908795a993148553a04be25748942efc (diff) | |
download | CMake-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.cxx | 13 |
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; } |