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

Method GetSourceGroup

Source/cmMakefile.cxx:2104–2128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2102}
2103
2104cmSourceGroup* cmMakefile::GetSourceGroup(
2105 std::vector<std::string> const& name) const
2106{
2107 cmSourceGroup* sg = nullptr;
2108
2109 // first look for source group starting with the same as the one we want
2110 for (auto const& srcGroup : this->SourceGroups) {
2111 std::string const& sgName = srcGroup->GetName();
2112 if (sgName == name[0]) {
2113 sg = srcGroup.get();
2114 break;
2115 }
2116 }
2117
2118 if (sg) {
2119 // iterate through its children to find match source group
2120 for (unsigned int i = 1; i < name.size(); ++i) {
2121 sg = sg->LookupChild(name[i]);
2122 if (!sg) {
2123 break;
2124 }
2125 }
2126 }
2127 return sg;
2128}
2129
2130void cmMakefile::AddSourceGroup(std::string const& name, char const* regex)
2131{

Callers 2

AddSourceGroupMethod · 0.95

Calls 4

LookupChildMethod · 0.80
GetNameMethod · 0.45
getMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected