diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2023-05-21 12:26:08 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2023-05-21 12:26:08 (GMT) |
commit | 5884303e692b342ad444c5ab01caf7c219e735af (patch) | |
tree | 4d788ac62da34442b8085eda62a99a533f0a65f7 /Source/cmGlobalGenerator.cxx | |
parent | f32e275f2993f13e7a9c59bdcc5e1942b23a228d (diff) | |
download | CMake-5884303e692b342ad444c5ab01caf7c219e735af.zip CMake-5884303e692b342ad444c5ab01caf7c219e735af.tar.gz CMake-5884303e692b342ad444c5ab01caf7c219e735af.tar.bz2 |
Apple Framework: enhance path parsing
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 040f500..5d0f8b2 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2598,14 +2598,14 @@ cmGlobalGenerator::SplitFrameworkPath(const std::string& path, // or (/path/to/)?FwName.framework/FwName(.tbd)? // or (/path/to/)?FwName.framework/Versions/*/FwName(.tbd)? static cmsys::RegularExpression frameworkPath( - "((.+)/)?(.+)\\.framework(/Versions/[^/]+)?(/(.+))?$"); + "((.+)/)?([^/]+)\\.framework(/Versions/([^/]+))?(/(.+))?$"); auto ext = cmSystemTools::GetFilenameLastExtension(path); if ((ext.empty() || ext == ".tbd" || ext == ".framework") && frameworkPath.find(path)) { auto name = frameworkPath.match(3); auto libname = - cmSystemTools::GetFilenameWithoutExtension(frameworkPath.match(6)); + cmSystemTools::GetFilenameWithoutExtension(frameworkPath.match(7)); if (format == FrameworkFormat::Strict && libname.empty()) { return cm::nullopt; } @@ -2614,11 +2614,12 @@ cmGlobalGenerator::SplitFrameworkPath(const std::string& path, } if (libname.empty() || name.size() == libname.size()) { - return FrameworkDescriptor{ frameworkPath.match(2), name }; + return FrameworkDescriptor{ frameworkPath.match(2), + frameworkPath.match(5), name }; } - return FrameworkDescriptor{ frameworkPath.match(2), name, - libname.substr(name.size()) }; + return FrameworkDescriptor{ frameworkPath.match(2), frameworkPath.match(5), + name, libname.substr(name.size()) }; } if (format == FrameworkFormat::Extended) { |