| 2748 | #endif |
| 2749 | |
| 2750 | bool 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 | |
| 2777 | void cmFindPackageCommand::FillPrefixesCMakeSystemVariable() |
| 2778 | { |
no test coverage detected