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

Method InitScanFiles

Source/cmQtAutoGenInitializer.cxx:961–1363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

959}
960
961bool 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

Callers 1

InitCustomTargetsMethod · 0.95

Calls 15

MocOrUicEnabledMethod · 0.95
ConfigFileNameCommonMethod · 0.95
ConfigFileNamesMethod · 0.95
moveFunction · 0.85
cmExpandListFunction · 0.85
GetIsGeneratedMethod · 0.80
emplace_backMethod · 0.80
emplaceMethod · 0.80
push_backMethod · 0.80
GetAllConfigSourcesMethod · 0.80
GetExtensionMethod · 0.80

Tested by

no test coverage detected