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

Method CheckDirectory

Source/cmFindPackageCommand.cxx:2892–2913  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2890}
2891
2892bool cmFindPackageCommand::CheckDirectory(std::string const& dir,
2893 PackageDescriptionType type)
2894{
2895 assert(!dir.empty() && dir.back() == '/');
2896
2897 std::string const d = dir.substr(0, dir.size() - 1);
2898 if (cm::contains(this->IgnoredPaths, d)) {
2899 this->ConsideredPaths.emplace_back(
2900 dir, cmFindPackageCommand::FoundMode(type), SearchResult::Ignored);
2901 return false;
2902 }
2903
2904 // Look for the file in this directory.
2905 std::string file;
2906 FoundPackageMode foundMode = FoundPackageMode::None;
2907 if (this->FindConfigFile(d, type, file, foundMode)) {
2908 this->FileFound = std::move(file);
2909 this->FileFoundMode = foundMode;
2910 return true;
2911 }
2912 return false;
2913}
2914
2915bool cmFindPackageCommand::FindConfigFile(std::string const& dir,
2916 PackageDescriptionType type,

Callers 1

SearchDirectoryMethod · 0.95

Calls 7

FindConfigFileMethod · 0.95
moveFunction · 0.85
emplace_backMethod · 0.80
emptyMethod · 0.45
backMethod · 0.45
substrMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected