diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2017-02-22 16:52:16 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2017-02-22 16:52:16 (GMT) |
commit | 2a6fd4328adfad4cae0097d6d71e571c122fc0d1 (patch) | |
tree | ba76a9bd46217105b068a4a23987a92ae2e3936f /Source | |
parent | e9a8a207ad6817cc93eab2b878de090b5ece8bfe (diff) | |
download | CMake-2a6fd4328adfad4cae0097d6d71e571c122fc0d1.zip CMake-2a6fd4328adfad4cae0097d6d71e571c122fc0d1.tar.gz CMake-2a6fd4328adfad4cae0097d6d71e571c122fc0d1.tar.bz2 |
Autogen: Single point of return in Run() method
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmQtAutoGenerators.cxx | 34 |
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"); |