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

Method AddToSourceGroup

Source/cmQtAutoGenInitializer.cxx:2192–2228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2190}
2191
2192void cmQtAutoGenInitializer::AddToSourceGroup(std::string const& fileName,
2193 cm::string_view genNameUpper)
2194{
2195 cmSourceGroup* sourceGroup = nullptr;
2196 // Acquire source group
2197 {
2198 std::string property;
2199 std::string groupName;
2200 {
2201 // Prefer generator specific source group name
2202 std::initializer_list<std::string> const props{
2203 cmStrCat(genNameUpper, "_SOURCE_GROUP"), "AUTOGEN_SOURCE_GROUP"
2204 };
2205 for (std::string const& prop : props) {
2206 cmValue propName = this->Makefile->GetState()->GetGlobalProperty(prop);
2207 if (cmNonempty(propName)) {
2208 groupName = *propName;
2209 property = prop;
2210 break;
2211 }
2212 }
2213 }
2214 // Generate a source group on demand
2215 if (!groupName.empty()) {
2216 sourceGroup = this->Makefile->GetOrCreateSourceGroup(groupName);
2217 if (!sourceGroup) {
2218 cmSystemTools::Error(
2219 cmStrCat(genNameUpper, " error in ", property,
2220 ": Could not find or create the source group ",
2221 cmQtAutoGen::Quoted(groupName)));
2222 }
2223 }
2224 }
2225 if (sourceGroup) {
2226 sourceGroup->AddGroupFile(fileName);
2227 }
2228}
2229
2230void cmQtAutoGenInitializer::AddCleanFile(std::string const& fileName)
2231{

Callers 1

AddGeneratedSourceMethod · 0.95

Calls 8

cmNonemptyFunction · 0.85
GetGlobalPropertyMethod · 0.80
AddGroupFileMethod · 0.80
cmStrCatFunction · 0.70
ErrorClass · 0.70
GetStateMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected