| 2879 | } |
| 2880 | |
| 2881 | void cmQtAutoMocUicT::SettingsFileRead() |
| 2882 | { |
| 2883 | // Compose current settings strings |
| 2884 | { |
| 2885 | cmCryptoHash cryptoHash(cmCryptoHash::AlgoSHA256); |
| 2886 | auto cha = [&cryptoHash](cm::string_view value) { |
| 2887 | cryptoHash.Append(value); |
| 2888 | cryptoHash.Append(";"); |
| 2889 | }; |
| 2890 | |
| 2891 | if (this->MocConst_.Enabled) { |
| 2892 | cryptoHash.Initialize(); |
| 2893 | cha(this->MocConst().Executable); |
| 2894 | for (auto const& item : this->MocConst().OptionsDefinitions) { |
| 2895 | cha(item); |
| 2896 | } |
| 2897 | for (auto const& item : this->MocConst().OptionsIncludes) { |
| 2898 | cha(item); |
| 2899 | } |
| 2900 | for (auto const& item : this->MocConst().OptionsExtra) { |
| 2901 | cha(item); |
| 2902 | } |
| 2903 | for (auto const& item : this->MocConst().PredefsCmd) { |
| 2904 | cha(item); |
| 2905 | } |
| 2906 | for (auto const& filter : this->MocConst().DependFilters) { |
| 2907 | cha(filter.Key); |
| 2908 | } |
| 2909 | for (auto const& filter : this->MocConst().MacroFilters) { |
| 2910 | cha(filter.Key); |
| 2911 | } |
| 2912 | this->SettingsStringMoc_ = cryptoHash.FinalizeHex(); |
| 2913 | } |
| 2914 | |
| 2915 | if (this->UicConst().Enabled) { |
| 2916 | cryptoHash.Initialize(); |
| 2917 | cha(this->UicConst().Executable); |
| 2918 | std::for_each(this->UicConst().Options.begin(), |
| 2919 | this->UicConst().Options.end(), cha); |
| 2920 | for (auto const& item : this->UicConst().UiFiles) { |
| 2921 | cha(item.first); |
| 2922 | auto const& opts = item.second.Options; |
| 2923 | std::for_each(opts.begin(), opts.end(), cha); |
| 2924 | } |
| 2925 | this->SettingsStringUic_ = cryptoHash.FinalizeHex(); |
| 2926 | } |
| 2927 | } |
| 2928 | |
| 2929 | // Read old settings and compare |
| 2930 | { |
| 2931 | std::string content; |
| 2932 | if (cmQtAutoGenerator::FileRead(content, this->SettingsFile_)) { |
| 2933 | if (this->MocConst().Enabled) { |
| 2934 | if (this->SettingsStringMoc_ != SettingsFind(content, "moc")) { |
| 2935 | this->MocConst_.SettingsChanged = true; |
| 2936 | } |
| 2937 | } |
| 2938 | if (this->UicConst().Enabled) { |
no test coverage detected