| 2102 | } |
| 2103 | |
| 2104 | cmSourceGroup* 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 | |
| 2130 | void cmMakefile::AddSourceGroup(std::string const& name, char const* regex) |
| 2131 | { |
no test coverage detected