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

Method SettingsFileWrite

Source/cmQtAutoMocUic.cxx:2962–2996  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2960}
2961
2962bool cmQtAutoMocUicT::SettingsFileWrite()
2963{
2964 // Only write if any setting changed
2965 if (this->MocConst().SettingsChanged || this->UicConst().SettingsChanged) {
2966 if (this->Log().Verbose()) {
2967 this->Log().Info(GenT::GEN,
2968 cmStrCat("Writing the settings file ",
2969 this->MessagePath(this->SettingsFile_)));
2970 }
2971 // Compose settings file content
2972 std::string content;
2973 {
2974 auto SettingAppend = [&content](cm::string_view key,
2975 cm::string_view value) {
2976 if (!value.empty()) {
2977 content += cmStrCat(key, ':', value, '\n');
2978 }
2979 };
2980 SettingAppend("moc", this->SettingsStringMoc_);
2981 SettingAppend("uic", this->SettingsStringUic_);
2982 }
2983 // Write settings file
2984 std::string error;
2985 if (!cmQtAutoGenerator::FileWrite(this->SettingsFile_, content, &error)) {
2986 this->Log().Error(GenT::GEN,
2987 cmStrCat("Writing the settings file ",
2988 this->MessagePath(this->SettingsFile_),
2989 " failed.\n", error));
2990 // Remove old settings file to trigger a full rebuild on the next run
2991 cmSystemTools::RemoveFile(this->SettingsFile_);
2992 return false;
2993 }
2994 }
2995 return true;
2996}
2997
2998void cmQtAutoMocUicT::ParseCacheRead()
2999{

Callers 1

ProcessMethod · 0.95

Calls 7

VerboseMethod · 0.80
InfoMethod · 0.80
cmStrCatFunction · 0.70
LogMethod · 0.45
MessagePathMethod · 0.45
emptyMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected