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

Function HandleTargetMode

Source/cmSetPropertyCommand.cxx:709–739  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

707}
708
709bool HandleTargetMode(cmExecutionStatus& status,
710 std::set<std::string> const& names,
711 std::string const& propertyName,
712 std::string const& propertyValue, bool appendAsString,
713 bool appendMode, bool remove)
714{
715 for (std::string const& name : names) {
716 if (status.GetMakefile().IsAlias(name)) {
717 status.SetError("can not be used on an ALIAS target.");
718 return false;
719 }
720
721 if (cmTarget* target = status.GetMakefile().FindTargetToUse(name)) {
722 if (target->IsSymbolic()) {
723 status.SetError("can not be used on a SYMBOLIC target.");
724 return false;
725 }
726
727 // Handle the current target.
728 if (!HandleTarget(target, status.GetMakefile(), propertyName,
729 propertyValue, appendAsString, appendMode, remove)) {
730 return false;
731 }
732 } else {
733 status.SetError(cmStrCat("could not find TARGET ", name,
734 ". Perhaps it has not yet been created."));
735 return false;
736 }
737 }
738 return true;
739}
740
741bool HandleTarget(cmTarget* target, cmMakefile& makefile,
742 std::string const& propertyName,

Callers 1

cmSetPropertyCommandFunction · 0.70

Calls 7

HandleTargetFunction · 0.85
FindTargetToUseMethod · 0.80
cmStrCatFunction · 0.70
IsAliasMethod · 0.45
GetMakefileMethod · 0.45
SetErrorMethod · 0.45
IsSymbolicMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…