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

Method FillPrefixesSystemEnvironment

Source/cmFindPackageCommand.cxx:2566–2589  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2564}
2565
2566void 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
2591void cmFindPackageCommand::FillPrefixesUserRegistry()
2592{

Callers 1

ComputePrefixesMethod · 0.95

Calls 5

cmHasLiteralSuffixFunction · 0.85
collectPathsForDebugFunction · 0.85
DebugModeEnabledMethod · 0.80
cmStrCatFunction · 0.70
AddPathMethod · 0.45

Tested by

no test coverage detected