| 959 | } |
| 960 | |
| 961 | bool cmQtAutoGenInitializer::InitScanFiles() |
| 962 | { |
| 963 | cmake const* cm = this->Makefile->GetCMakeInstance(); |
| 964 | auto const& kw = this->GlobalInitializer->kw(); |
| 965 | |
| 966 | auto makeMUFile = [this, &kw](cmSourceFile* sf, std::string const& fullPath, |
| 967 | std::vector<size_t> const& configs, |
| 968 | bool muIt) -> MUFileHandle { |
| 969 | MUFileHandle muf = cm::make_unique<MUFile>(); |
| 970 | muf->FullPath = fullPath; |
| 971 | muf->SF = sf; |
| 972 | if (!configs.empty() && configs.size() != this->ConfigsList.size()) { |
| 973 | muf->Configs = configs; |
| 974 | } |
| 975 | muf->Generated = sf->GetIsGenerated(); |
| 976 | bool const skipAutogen = sf->GetPropertyAsBool(kw.SKIP_AUTOGEN); |
| 977 | muf->SkipMoc = this->Moc.Enabled && |
| 978 | (skipAutogen || sf->GetPropertyAsBool(kw.SKIP_AUTOMOC)); |
| 979 | muf->SkipUic = this->Uic.Enabled && |
| 980 | (skipAutogen || sf->GetPropertyAsBool(kw.SKIP_AUTOUIC)); |
| 981 | if (muIt) { |
| 982 | muf->MocIt = this->Moc.Enabled && !muf->SkipMoc; |
| 983 | muf->UicIt = this->Uic.Enabled && !muf->SkipUic; |
| 984 | } |
| 985 | return muf; |
| 986 | }; |
| 987 | |
| 988 | auto addMUHeader = [this](MUFileHandle&& muf, cm::string_view extension) { |
| 989 | cmSourceFile* sf = muf->SF; |
| 990 | bool const muIt = (muf->MocIt || muf->UicIt); |
| 991 | if (this->CMP0100Accept || (extension != "hh")) { |
| 992 | // Accept |
| 993 | if (muIt && muf->Generated) { |
| 994 | this->AutogenTarget.FilesGenerated.emplace_back(muf.get()); |
| 995 | } |
| 996 | this->AutogenTarget.Headers.emplace(sf, std::move(muf)); |
| 997 | } else if (muIt && this->CMP0100Warn) { |
| 998 | // Store file for warning message |
| 999 | this->AutogenTarget.CMP0100HeadersWarn.push_back(sf); |
| 1000 | } |
| 1001 | }; |
| 1002 | |
| 1003 | auto addMUSource = [this](MUFileHandle&& muf) { |
| 1004 | if ((muf->MocIt || muf->UicIt) && muf->Generated) { |
| 1005 | this->AutogenTarget.FilesGenerated.emplace_back(muf.get()); |
| 1006 | } |
| 1007 | this->AutogenTarget.Sources.emplace(muf->SF, std::move(muf)); |
| 1008 | }; |
| 1009 | |
| 1010 | // Scan through target files |
| 1011 | { |
| 1012 | // Scan through target files |
| 1013 | for (cmGeneratorTarget::AllConfigSource const& acs : |
| 1014 | this->GenTarget->GetAllConfigSources()) { |
| 1015 | std::string const& fullPath = acs.Source->GetFullPath(); |
| 1016 | std::string const& extLower = |
| 1017 | cmSystemTools::LowerCase(acs.Source->GetExtension()); |
| 1018 |
no test coverage detected