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

Method WriteEvent

Source/cmFindPackageCommand.cxx:3630–3844  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3628
3629#ifndef CMAKE_BOOTSTRAP
3630void cmFindPackageDebugState::WriteEvent(cmConfigureLog& log,
3631 cmMakefile const& mf) const
3632{
3633 (void)log;
3634 (void)mf;
3635
3636 log.BeginEvent("find_package-v1", mf);
3637
3638 auto const* fpc = this->FindPackageCommand;
3639
3640 log.WriteValue("name"_s, fpc->Name);
3641 if (!fpc->Components.empty()) {
3642 log.BeginObject("components"_s);
3643 log.BeginArray();
3644 for (auto const& component : cmList{ fpc->Components }) {
3645 log.NextArrayElement();
3646 log.WriteValue("name"_s, component);
3647 log.WriteValue("required"_s,
3648 fpc->RequiredComponents.find(component) !=
3649 fpc->RequiredComponents.end());
3650 log.WriteValue("found"_s,
3651 mf.IsOn(cmStrCat(fpc->Name, '_', component, "_FOUND")));
3652 }
3653 log.EndArray();
3654 log.EndObject();
3655 }
3656 if (!fpc->Configs.empty()) {
3657 auto pdt_name =
3658 [](cmFindPackageCommand::PackageDescriptionType type) -> std::string {
3659 switch (type) {
3660 case pdt::Any:
3661 return "any";
3662 case pdt::CMake:
3663 return "cmake";
3664 case pdt::Cps:
3665 return "cps";
3666 }
3667 assert(false);
3668 return "<UNKNOWN>";
3669 };
3670
3671 log.BeginObject("configs"_s);
3672 log.BeginArray();
3673 for (auto const& config : fpc->Configs) {
3674 log.NextArrayElement();
3675 log.WriteValue("filename"_s, config.Name);
3676 log.WriteValue("kind"_s, pdt_name(config.Type));
3677 }
3678 log.EndArray();
3679 log.EndObject();
3680 }
3681 {
3682 log.BeginObject("version_request"_s);
3683 if (!fpc->Version.empty()) {
3684 log.WriteValue("version"_s, fpc->Version);
3685 }
3686 if (!fpc->VersionComplete.empty()) {
3687 log.WriteValue("version_complete"_s, fpc->VersionComplete);

Callers

nothing calls this directly

Calls 14

BeginEventMethod · 0.80
WriteValueMethod · 0.80
NextArrayElementMethod · 0.80
WriteSearchVariablesMethod · 0.80
EndEventMethod · 0.80
cmStrCatFunction · 0.70
emptyMethod · 0.45
BeginObjectMethod · 0.45
BeginArrayMethod · 0.45
findMethod · 0.45
endMethod · 0.45
IsOnMethod · 0.45

Tested by

no test coverage detected