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

Function cmTryRunCommand

Source/cmTryRunCommand.cxx:540–561  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

538}
539
540bool cmTryRunCommand(std::vector<std::string> const& args,
541 cmExecutionStatus& status)
542{
543 cmMakefile& mf = status.GetMakefile();
544
545 if (args.size() < 4) {
546 mf.IssueMessage(MessageType::FATAL_ERROR,
547 "The try_run() command requires at least 4 arguments.");
548 return false;
549 }
550
551 if (mf.GetCMakeInstance()->GetState()->GetRole() ==
552 cmState::Role::FindPackage) {
553 mf.IssueMessage(
554 MessageType::FATAL_ERROR,
555 "The try_run() command is not supported in --find-package mode.");
556 return false;
557 }
558
559 TryRunCommandImpl tr(&mf);
560 return tr.TryRunCode(args);
561}

Callers

nothing calls this directly

Calls 7

GetRoleMethod · 0.80
TryRunCodeMethod · 0.80
GetMakefileMethod · 0.45
sizeMethod · 0.45
IssueMessageMethod · 0.45
GetStateMethod · 0.45
GetCMakeInstanceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…