| 2564 | } |
| 2565 | |
| 2566 | void cmFindPackageCommand::FillPrefixesSystemEnvironment() |
| 2567 | { |
| 2568 | cmSearchPath& paths = this->LabeledPaths[PathLabel::SystemEnvironment]; |
| 2569 | |
| 2570 | // Use the system search path to generate prefixes. |
| 2571 | // Relative paths are interpreted with respect to the current |
| 2572 | // working directory. |
| 2573 | std::vector<std::string> envPATH = |
| 2574 | cmSystemTools::GetEnvPathNormalized("PATH"); |
| 2575 | for (std::string const& i : envPATH) { |
| 2576 | // If the path is a PREFIX/bin case then add its parent instead. |
| 2577 | if ((cmHasLiteralSuffix(i, "/bin")) || (cmHasLiteralSuffix(i, "/sbin"))) { |
| 2578 | paths.AddPath(cmSystemTools::GetFilenamePath(i)); |
| 2579 | } else { |
| 2580 | paths.AddPath(i); |
| 2581 | } |
| 2582 | } |
| 2583 | if (this->DebugModeEnabled()) { |
| 2584 | std::string debugBuffer = "Standard system environment variables " |
| 2585 | "[CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH].\n"; |
| 2586 | collectPathsForDebug(debugBuffer, paths); |
| 2587 | this->DebugBuffer = cmStrCat(this->DebugBuffer, debugBuffer); |
| 2588 | } |
| 2589 | } |
| 2590 | |
| 2591 | void cmFindPackageCommand::FillPrefixesUserRegistry() |
| 2592 | { |
no test coverage detected