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

Method FindAppendices

Source/cmFindPackageCommand.cxx:2042–2075  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2040}
2041
2042cmFindPackageCommand::AppendixMap cmFindPackageCommand::FindAppendices(
2043 std::string const& base, cmPackageInfoReader const& baseReader) const
2044{
2045 AppendixMap appendices;
2046
2047 // Find package appendices.
2048 cmsys::Glob glob;
2049 glob.RecurseOff();
2050 if (glob.FindFiles(cmStrCat(cmSystemTools::GetFilenamePath(base), "/"_s,
2051 cmSystemTools::GetFilenameWithoutExtension(base),
2052 "[-:]*.[Cc][Pp][Ss]"_s))) {
2053 // Check glob results for valid appendices.
2054 for (std::string const& extra : glob.GetFiles()) {
2055 // Exclude configuration-specific files for now; we look at them later
2056 // when we load their respective configuration-agnostic appendices.
2057 if (extra.find('@') != std::string::npos) {
2058 continue;
2059 }
2060
2061 cmMakefile::CallRAII cs{ this->Makefile, extra, this->Status };
2062
2063 std::unique_ptr<cmPackageInfoReader> reader =
2064 cmPackageInfoReader::Read(this->Makefile, extra, &baseReader);
2065
2066 if (reader && reader->GetName() == this->Name) {
2067 std::vector<std::string> components = reader->GetComponentNames();
2068 Appendix appendix{ std::move(reader), std::move(components) };
2069 appendices.emplace(extra, std::move(appendix));
2070 }
2071 }
2072 }
2073
2074 return appendices;
2075}
2076
2077bool cmFindPackageCommand::ReadListFile(std::string const& f,
2078 PolicyScopeRule const psr)

Callers 1

CheckVersionMethod · 0.95

Calls 8

moveFunction · 0.85
FindFilesMethod · 0.80
GetComponentNamesMethod · 0.80
emplaceMethod · 0.80
cmStrCatFunction · 0.70
GetFilesMethod · 0.45
findMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected