MCPcopy Create free account
hub / github.com/Kitware/CMake / SearchAppBundlePrefix

Method SearchAppBundlePrefix

Source/cmFindPackageCommand.cxx:3503–3530  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3501}
3502
3503bool 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
3532bool cmFindPackageCommand::SearchEnvironmentPrefix(std::string const& prefix)
3533{

Callers 1

FindAppBundleConfigMethod · 0.95

Calls 4

SearchDirectoryMethod · 0.95
TryGeneratedPathsFunction · 0.85
emptyMethod · 0.45
backMethod · 0.45

Tested by

no test coverage detected