| 3501 | } |
| 3502 | |
| 3503 | bool cmFindPackageCommand::SearchAppBundlePrefix(std::string const& prefix) |
| 3504 | { |
| 3505 | assert(!prefix.empty() && prefix.back() == '/'); |
| 3506 | |
| 3507 | auto searchFn = [this](std::string const& fullPath, |
| 3508 | PackageDescriptionType type) -> bool { |
| 3509 | return this->SearchDirectory(fullPath, type); |
| 3510 | }; |
| 3511 | |
| 3512 | auto appGen = cmMacProjectDirectoryListGenerator{ &this->Names, ".app"_s }; |
| 3513 | auto crGen = cmAppendPathSegmentGenerator{ "Contents/Resources"_s }; |
| 3514 | |
| 3515 | // <prefix>/Foo.app/Contents/Resources/CPS/ |
| 3516 | if (TryGeneratedPaths(searchFn, pdt::Cps, prefix, appGen, crGen, |
| 3517 | cmCaseInsensitiveDirectoryListGenerator{ "cps"_s })) { |
| 3518 | return true; |
| 3519 | } |
| 3520 | |
| 3521 | // <prefix>/Foo.app/Contents/Resources/ |
| 3522 | if (TryGeneratedPaths(searchFn, pdt::CMake, prefix, appGen, crGen)) { |
| 3523 | return true; |
| 3524 | } |
| 3525 | |
| 3526 | // <prefix>/Foo.app/Contents/Resources/CMake/ |
| 3527 | return TryGeneratedPaths( |
| 3528 | searchFn, pdt::CMake, prefix, appGen, crGen, |
| 3529 | cmCaseInsensitiveDirectoryListGenerator{ "cmake"_s }); |
| 3530 | } |
| 3531 | |
| 3532 | bool cmFindPackageCommand::SearchEnvironmentPrefix(std::string const& prefix) |
| 3533 | { |
no test coverage detected