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

Function HandleTargetMode

Source/cmGetPropertyCommand.cxx:404–441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

402}
403
404bool HandleTargetMode(cmExecutionStatus& status, std::string const& name,
405 OutType infoType, std::string const& variable,
406 std::string const& propertyName)
407{
408 if (name.empty()) {
409 status.SetError("not given name for TARGET scope.");
410 return false;
411 }
412
413 if (cmTarget* target = status.GetMakefile().FindTargetToUse(name)) {
414 if (propertyName == "ALIASED_TARGET" || propertyName == "ALIAS_GLOBAL") {
415 if (status.GetMakefile().IsAlias(name)) {
416 if (propertyName == "ALIASED_TARGET") {
417
418 return StoreResult(infoType, status.GetMakefile(), variable,
419 target->GetName().c_str());
420 }
421 if (propertyName == "ALIAS_GLOBAL") {
422 return StoreResult(
423 infoType, status.GetMakefile(), variable,
424 status.GetMakefile().GetGlobalGenerator()->IsAlias(name)
425 ? "TRUE"
426 : "FALSE");
427 }
428 }
429 return StoreResult(infoType, status.GetMakefile(), variable, nullptr);
430 }
431 cmValue prop =
432 target->GetComputedProperty(propertyName, status.GetMakefile());
433 if (!prop) {
434 prop = target->GetProperty(propertyName);
435 }
436 return StoreResult(infoType, status.GetMakefile(), variable, prop);
437 }
438 status.SetError(cmStrCat("could not find TARGET ", name,
439 ". Perhaps it has not yet been created."));
440 return false;
441}
442
443bool HandleFileSetMode(cmExecutionStatus& status, std::string const& name,
444 OutType infoType, std::string const& variable,

Callers 1

cmGetPropertyCommandFunction · 0.70

Calls 12

FindTargetToUseMethod · 0.80
c_strMethod · 0.80
GetComputedPropertyMethod · 0.80
StoreResultFunction · 0.70
cmStrCatFunction · 0.70
emptyMethod · 0.45
SetErrorMethod · 0.45
GetMakefileMethod · 0.45
IsAliasMethod · 0.45
GetNameMethod · 0.45
GetGlobalGeneratorMethod · 0.45
GetPropertyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…