| 2190 | } |
| 2191 | |
| 2192 | void 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 | |
| 2230 | void cmQtAutoGenInitializer::AddCleanFile(std::string const& fileName) |
| 2231 | { |
no test coverage detected