summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2017-02-14 17:31:13 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2017-02-19 11:35:40 (GMT)
commit119876e6d5e71fb8a3f72ba35593ee43fd124203 (patch)
treebb57fc291adcbcfd9786a663793f009e347a563c
parentc88a3f72289a1fdfb9b47cdea025d50efee94501 (diff)
downloadCMake-119876e6d5e71fb8a3f72ba35593ee43fd124203.zip
CMake-119876e6d5e71fb8a3f72ba35593ee43fd124203.tar.gz
CMake-119876e6d5e71fb8a3f72ba35593ee43fd124203.tar.bz2
Autogen: Simplify settings write method
-rw-r--r--Source/cmQtAutoGenerators.cxx19
1 files changed, 10 insertions, 9 deletions
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 8e5c3fd..6f07716 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -65,6 +65,13 @@ inline static bool SettingsMatch(cmMakefile* makefile, const char* key,
return (value == makefile->GetSafeDefinition(key));
}
+static void SettingWrite(std::ostream& ostr, const char* key,
+ const std::string& value)
+{
+ ostr << "set(" << key << " " << cmOutputConverter::EscapeForCMake(value)
+ << ")\n";
+}
+
static std::string FindMatchingHeader(
const std::string& absPath, const std::string& mocSubDir,
const std::string& basename,
@@ -495,19 +502,13 @@ bool cmQtAutoGenerators::SettingsFileWrite(const std::string& targetDirectory)
outfile.open(filename.c_str(), std::ios::trunc);
if (outfile) {
if (!this->MocExecutable.empty()) {
- outfile << "set(" << SettingsKeyMoc << " "
- << cmOutputConverter::EscapeForCMake(this->MocSettingsString)
- << ")\n";
+ SettingWrite(outfile, SettingsKeyMoc, this->MocSettingsString);
}
if (!this->UicExecutable.empty()) {
- outfile << "set(" << SettingsKeyUic << " "
- << cmOutputConverter::EscapeForCMake(this->UicSettingsString)
- << ")\n";
+ SettingWrite(outfile, SettingsKeyUic, this->UicSettingsString);
}
if (!this->RccExecutable.empty()) {
- outfile << "set(" << SettingsKeyRcc << " "
- << cmOutputConverter::EscapeForCMake(this->RccSettingsString)
- << ")\n";
+ SettingWrite(outfile, SettingsKeyRcc, this->RccSettingsString);
}
success = outfile.good();
outfile.close();