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

Method CheckPackageRegistryEntry

Source/cmFindPackageCommand.cxx:2750–2775  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2748#endif
2749
2750bool cmFindPackageCommand::CheckPackageRegistryEntry(std::string const& fname,
2751 cmSearchPath& outPaths)
2752{
2753 // Parse the content of one package registry entry.
2754 if (cmSystemTools::FileIsFullPath(fname)) {
2755 // The first line in the stream is the full path to a file or
2756 // directory containing the package.
2757 if (cmSystemTools::FileExists(fname)) {
2758 // The path exists. Look for the package here.
2759 if (!cmSystemTools::FileIsDirectory(fname)) {
2760 outPaths.AddPath(cmSystemTools::GetFilenamePath(fname));
2761 } else {
2762 outPaths.AddPath(fname);
2763 }
2764 return true;
2765 }
2766 // The path does not exist. Assume the stream content is
2767 // associated with an old package that no longer exists, and
2768 // delete it to keep the package registry clean.
2769 return false;
2770 }
2771 // The first line in the stream is not the full path to a file or
2772 // directory. Assume the stream content was created by a future
2773 // version of CMake that uses a different format, and leave it.
2774 return true;
2775}
2776
2777void cmFindPackageCommand::FillPrefixesCMakeSystemVariable()
2778{

Callers 2

Calls 2

FileExistsFunction · 0.50
AddPathMethod · 0.45

Tested by

no test coverage detected