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

Function HandleCommon

Source/cmCMakePkgConfigCommand.cxx:639–684  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

637}
638
639cm::optional<std::pair<cmPkgConfigEnv, ImportEnv>> HandleCommon(
640 CommonArguments& args, cmExecutionStatus& status)
641{
642
643 auto& mf = status.GetMakefile();
644
645 if (!args.CheckArgs(status)) {
646 return {};
647 }
648
649 cmPkgConfigEnv pcEnv;
650
651 if (args.PcLibdir) {
652 pcEnv.LibDirs = std::move(*args.PcLibdir);
653 }
654
655 if (args.PcPath) {
656 pcEnv.Path = std::move(*args.PcPath);
657 }
658
659 pcEnv.DisableUninstalled = args.DisableUninstalled;
660
661 if (args.SysrootDir) {
662 pcEnv.SysrootDir = std::move(*args.SysrootDir);
663 }
664
665 if (args.TopBuildDir) {
666 pcEnv.TopBuildDir = std::move(*args.TopBuildDir);
667 }
668
669 CollectEnv(mf, pcEnv, args.EnvMode);
670
671 if (pcEnv.Path) {
672 pcEnv.search = *pcEnv.Path;
673 if (pcEnv.LibDirs) {
674 pcEnv.search += *pcEnv.LibDirs;
675 }
676 } else if (pcEnv.LibDirs) {
677 pcEnv.search = *pcEnv.LibDirs;
678 }
679
680 return std::pair<cmPkgConfigEnv, ImportEnv>{
681 pcEnv,
682 { args.Required, args.Quiet, args.Exact, false, args.Strictness, status }
683 };
684}
685
686struct ExtractArguments : CommonArguments
687{

Callers 2

HandleExtractCommandFunction · 0.85
PopulatePCTargetFunction · 0.85

Calls 4

moveFunction · 0.85
CollectEnvFunction · 0.85
CheckArgsMethod · 0.80
GetMakefileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…