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

Function AddCustomCommandToTarget

Source/cmLocalGenerator.cxx:5070–5094  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5068
5069namespace detail {
5070void AddCustomCommandToTarget(cmLocalGenerator& lg, cmCommandOrigin origin,
5071 cmTarget* target, cmCustomCommandType type,
5072 std::unique_ptr<cmCustomCommand> cc)
5073{
5074 // Add the command to the appropriate build step for the target.
5075 cc->SetEscapeAllowMakeVars(true);
5076 cc->SetTarget(target->GetName());
5077
5078 lg.AddTargetByproducts(target, cc->GetByproducts(), cc->GetBacktrace(),
5079 origin);
5080
5081 switch (type) {
5082 case cmCustomCommandType::PRE_BUILD:
5083 target->AddPreBuildCommand(std::move(*cc));
5084 break;
5085 case cmCustomCommandType::PRE_LINK:
5086 target->AddPreLinkCommand(std::move(*cc));
5087 break;
5088 case cmCustomCommandType::POST_BUILD:
5089 target->AddPostBuildCommand(std::move(*cc));
5090 break;
5091 }
5092
5093 cc.reset();
5094}
5095
5096cmSourceFile* AddCustomCommandToOutput(cmLocalGenerator& lg,
5097 cmCommandOrigin origin,

Callers 2

Calls 10

moveFunction · 0.85
AddTargetByproductsMethod · 0.80
AddPreBuildCommandMethod · 0.80
AddPreLinkCommandMethod · 0.80
AddPostBuildCommandMethod · 0.80
SetTargetMethod · 0.45
GetNameMethod · 0.45
GetBacktraceMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…