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

Function HandleDirectoryMode

Source/cmGetPropertyCommand.cxx:373–402  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

371}
372
373bool HandleDirectoryMode(cmExecutionStatus& status, std::string const& name,
374 OutType infoType, std::string const& variable,
375 std::string const& propertyName)
376{
377 // Default to the current directory.
378 cmMakefile* mf = &status.GetMakefile();
379
380 // Lookup the directory if given.
381 if (!name.empty()) {
382 // Construct the directory name. Interpret relative paths with
383 // respect to the current directory.
384 std::string dir = cmSystemTools::CollapseFullPath(
385 name, status.GetMakefile().GetCurrentSourceDirectory());
386
387 // Lookup the generator.
388 mf = status.GetMakefile().GetGlobalGenerator()->FindMakefile(dir);
389 if (!mf) {
390 // Could not find the directory.
391 status.SetError(
392 "DIRECTORY scope provided but requested directory was not found. "
393 "This could be because the directory argument was invalid or, "
394 "it is valid but has not been processed yet.");
395 return false;
396 }
397 }
398
399 // Get the property.
400 return StoreResult(infoType, status.GetMakefile(), variable,
401 mf->GetProperty(propertyName));
402}
403
404bool HandleTargetMode(cmExecutionStatus& status, std::string const& name,
405 OutType infoType, std::string const& variable,

Callers 1

cmGetPropertyCommandFunction · 0.70

Calls 7

FindMakefileMethod · 0.80
StoreResultFunction · 0.70
GetMakefileMethod · 0.45
emptyMethod · 0.45
GetGlobalGeneratorMethod · 0.45
SetErrorMethod · 0.45
GetPropertyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…