mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-04 12:49:36 -06:00
Autogen: Single point of return in Run() method
This commit is contained in:
@@ -244,23 +244,20 @@ bool cmQtAutoGenerators::Run(const std::string& targetDirectory,
|
|||||||
CM_AUTO_PTR<cmMakefile> mf(new cmMakefile(&gg, snapshot));
|
CM_AUTO_PTR<cmMakefile> mf(new cmMakefile(&gg, snapshot));
|
||||||
gg.SetCurrentMakefile(mf.get());
|
gg.SetCurrentMakefile(mf.get());
|
||||||
|
|
||||||
if (!this->ReadAutogenInfoFile(mf.get(), targetDirectory, config)) {
|
bool success = false;
|
||||||
return false;
|
if (this->ReadAutogenInfoFile(mf.get(), targetDirectory, config)) {
|
||||||
}
|
// Read old settings
|
||||||
// Read old settings
|
this->SettingsFileRead(mf.get(), targetDirectory);
|
||||||
this->SettingsFileRead(mf.get(), targetDirectory);
|
// Init and run
|
||||||
// Init and run
|
this->Init(mf.get());
|
||||||
this->Init(mf.get());
|
if (this->RunAutogen()) {
|
||||||
if (this->QtMajorVersion == "4" || this->QtMajorVersion == "5") {
|
// Write current settings
|
||||||
if (!this->RunAutogen()) {
|
if (this->SettingsFileWrite(targetDirectory)) {
|
||||||
return false;
|
success = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Write latest settings
|
return success;
|
||||||
if (!this->SettingsFileWrite(targetDirectory)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmQtAutoGenerators::ReadAutogenInfoFile(
|
bool cmQtAutoGenerators::ReadAutogenInfoFile(
|
||||||
@@ -295,6 +292,13 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(
|
|||||||
this->QtMajorVersion =
|
this->QtMajorVersion =
|
||||||
makefile->GetSafeDefinition("AM_Qt5Core_VERSION_MAJOR");
|
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->MocExecutable = makefile->GetSafeDefinition("AM_QT_MOC_EXECUTABLE");
|
||||||
this->UicExecutable = makefile->GetSafeDefinition("AM_QT_UIC_EXECUTABLE");
|
this->UicExecutable = makefile->GetSafeDefinition("AM_QT_UIC_EXECUTABLE");
|
||||||
this->RccExecutable = makefile->GetSafeDefinition("AM_QT_RCC_EXECUTABLE");
|
this->RccExecutable = makefile->GetSafeDefinition("AM_QT_RCC_EXECUTABLE");
|
||||||
|
|||||||
Reference in New Issue
Block a user