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

Method FindSourceGroup

Source/cmSourceGroup.cxx:166–187  ·  view source on GitHub ↗

* Find a source group whose regular expression matches the filename * part of the given source name. Search backward through the list of * source groups, and take the first matching group found. This way * non-inherited SOURCE_GROUP commands will have precedence over * inherited ones. */

Source from the content-addressed store, hash-verified

164 * inherited ones.
165 */
166cmSourceGroup* cmSourceGroup::FindSourceGroup(std::string const& source,
167 SourceGroupVector const& groups)
168{
169 // First search for a group that lists the file explicitly.
170 for (auto sg = groups.rbegin(); sg != groups.rend(); ++sg) {
171 cmSourceGroup* result = (*sg)->MatchChildrenFiles(source);
172 if (result) {
173 return result;
174 }
175 }
176
177 // Now search for a group whose regex matches the file.
178 for (auto sg = groups.rbegin(); sg != groups.rend(); ++sg) {
179 cmSourceGroup* result = (*sg)->MatchChildrenRegex(source);
180 if (result) {
181 return result;
182 }
183 }
184
185 // Shouldn't get here, but just in case, return the default group.
186 return groups.data()->get();
187}
188
189void cmSourceGroupFiles::Add(cmSourceGroup const* sg, cmSourceFile const* sf)
190{

Callers 9

CreateGroupsMethod · 0.45
CreateLinksForTargetsMethod · 0.45
WriteSourcesMethod · 0.45
WriteVCProjFileMethod · 0.45
WriteGroupsMethod · 0.45
WriteGroupSourcesMethod · 0.45
GetCSharpSourceLinkMethod · 0.45
DumpSourceMethod · 0.45
DumpInterfaceSourceMethod · 0.45

Calls 6

rbeginMethod · 0.80
rendMethod · 0.80
MatchChildrenFilesMethod · 0.80
MatchChildrenRegexMethod · 0.80
getMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected