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

Method DumpDirectory

Source/cmFileAPICodemodel.cxx:791–834  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

789}
790
791Json::Value CodemodelConfig::DumpDirectory(Directory& d)
792{
793 Json::Value directory = this->DumpDirectoryObject(d);
794
795 std::string sourceDir = d.Snapshot.GetDirectory().GetCurrentSource();
796 directory["source"] = RelativeIfUnder(this->TopSource, sourceDir);
797
798 std::string buildDir = d.Snapshot.GetDirectory().GetCurrentBinary();
799 directory["build"] = RelativeIfUnder(this->TopBuild, buildDir);
800
801 cmStateSnapshot parentDir = d.Snapshot.GetBuildsystemDirectoryParent();
802 if (parentDir.IsValid()) {
803 directory["parentIndex"] = this->GetDirectoryIndex(parentDir);
804 }
805
806 Json::Value childIndexes = Json::arrayValue;
807 for (cmStateSnapshot const& child : d.Snapshot.GetChildren()) {
808 childIndexes.append(
809 this->GetDirectoryIndex(child.GetBuildsystemDirectory()));
810 }
811 if (!childIndexes.empty()) {
812 directory["childIndexes"] = std::move(childIndexes);
813 }
814
815 directory["projectIndex"] = d.ProjectIndex;
816
817 if (!d.BuildSystemTargetIndexes.empty()) {
818 directory["targetIndexes"] = std::move(d.BuildSystemTargetIndexes);
819 }
820 if (!d.AbstractTargetIndexes.empty()) {
821 directory["abstractTargetIndexes"] = std::move(d.AbstractTargetIndexes);
822 }
823
824 Json::Value minimumCMakeVersion = this->DumpMinimumCMakeVersion(d.Snapshot);
825 if (!minimumCMakeVersion.isNull()) {
826 directory["minimumCMakeVersion"] = std::move(minimumCMakeVersion);
827 }
828
829 if (d.HasInstallRule) {
830 directory["hasInstallRule"] = true;
831 }
832
833 return directory;
834}
835
836Json::Value CodemodelConfig::DumpDirectoryObject(Directory& d)
837{

Callers 1

DumpDirectoriesMethod · 0.95

Calls 13

DumpDirectoryObjectMethod · 0.95
GetDirectoryIndexMethod · 0.95
RelativeIfUnderFunction · 0.85
moveFunction · 0.85
GetChildrenMethod · 0.80
appendMethod · 0.80
isNullMethod · 0.80
GetDirectoryMethod · 0.45
IsValidMethod · 0.45

Tested by

no test coverage detected