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

Function GetPath

Source/cmCMakePkgConfigCommand.cxx:230–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230cm::optional<std::string> GetPath(cmMakefile& mf, char const* cachevar,
231 char const* envvar, char const* desc)
232{
233 cm::optional<std::string> result;
234
235 auto def = mf.GetDefinition(cachevar);
236 if (def) {
237 result = *def;
238 return result;
239 }
240
241 std::string path;
242 if (cmSystemTools::GetEnv(envvar, path)) {
243 mf.AddCacheDefinition(cachevar, path, desc, cmStateEnums::FILEPATH);
244 result = std::move(path);
245 return result;
246 }
247
248 return result;
249}
250
251cm::optional<std::string> GetSysrootDir(cmMakefile& mf)
252{

Callers 7

cmLocalGeneratorMethod · 0.85
GetSysrootDirFunction · 0.85
GetTopBuildDirFunction · 0.85
FindNameMethod · 0.85
FindProgramMethod · 0.85
CheckGetPathFunction · 0.85
Directory.cxxFile · 0.85

Calls 3

moveFunction · 0.85
GetDefinitionMethod · 0.45
AddCacheDefinitionMethod · 0.45

Tested by 1

CheckGetPathFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…