summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGenerators.cxx
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2017-02-22 16:52:16 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2017-02-22 16:52:16 (GMT)
commit2a6fd4328adfad4cae0097d6d71e571c122fc0d1 (patch)
treeba76a9bd46217105b068a4a23987a92ae2e3936f /Source/cmQtAutoGenerators.cxx
parente9a8a207ad6817cc93eab2b878de090b5ece8bfe (diff)
downloadCMake-2a6fd4328adfad4cae0097d6d71e571c122fc0d1.zip
CMake-2a6fd4328adfad4cae0097d6d71e571c122fc0d1.tar.gz
CMake-2a6fd4328adfad4cae0097d6d71e571c122fc0d1.tar.bz2
Autogen: Single point of return in Run() method
Diffstat (limited to 'Source/cmQtAutoGenerators.cxx')
-rw-r--r--Source/cmQtAutoGenerators.cxx34
1 files changed, 19 insertions, 15 deletions
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 373a192..4463d62 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -244,23 +244,20 @@ bool cmQtAutoGenerators::Run(const std::string& targetDirectory,
CM_AUTO_PTR<cmMakefile> mf(new cmMakefile(&gg, snapshot));
gg.SetCurrentMakefile(mf.get());
- if (!this->ReadAutogenInfoFile(mf.get(), targetDirectory, config)) {
- return false;
- }
- // Read old settings
- this->SettingsFileRead(mf.get(), targetDirectory);
- // Init and run
- this->Init(mf.get());
- if (this->QtMajorVersion == "4" || this->QtMajorVersion == "5") {
- if (!this->RunAutogen()) {
- return false;
+ bool success = false;
+ if (this->ReadAutogenInfoFile(mf.get(), targetDirectory, config)) {
+ // Read old settings
+ this->SettingsFileRead(mf.get(), targetDirectory);
+ // Init and run
+ this->Init(mf.get());
+ if (this->RunAutogen()) {
+ // Write current settings
+ if (this->SettingsFileWrite(targetDirectory)) {
+ success = true;
+ }
}
}
- // Write latest settings
- if (!this->SettingsFileWrite(targetDirectory)) {
- return false;
- }
- return true;
+ return success;
}
bool cmQtAutoGenerators::ReadAutogenInfoFile(
@@ -295,6 +292,13 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(
this->QtMajorVersion =
makefile->GetSafeDefinition("AM_Qt5Core_VERSION_MAJOR");
}
+ // Check Qt version
+ if ((this->QtMajorVersion != "4") && (this->QtMajorVersion != "5")) {
+ this->LogError("AutoGen: Error: Unsupported Qt version: \"" +
+ this->QtMajorVersion + "\"");
+ return false;
+ }
+
this->MocExecutable = makefile->GetSafeDefinition("AM_QT_MOC_EXECUTABLE");
this->UicExecutable = makefile->GetSafeDefinition("AM_QT_UIC_EXECUTABLE");
this->RccExecutable = makefile->GetSafeDefinition("AM_QT_RCC_EXECUTABLE");