diff --git a/src/plugins/qt4projectmanager/qmakestep.cpp b/src/plugins/qt4projectmanager/qmakestep.cpp index f1f8ed0fe88a136f967b32f3ff1cfa2c9378ba37..0c36f58bd17f913c5fd7cd2f6c40c9bea6f7e1db 100644 --- a/src/plugins/qt4projectmanager/qmakestep.cpp +++ b/src/plugins/qt4projectmanager/qmakestep.cpp @@ -80,6 +80,7 @@ const char * const QMAKE_QMLDEBUGLIB_KEY("QtProjectManager.QMakeBuildStep.LinkQm QMakeStep::QMakeStep(BuildStepList *bsl) : AbstractProcessStep(bsl, QLatin1String(QMAKE_BS_ID)), m_forced(false), + m_needToRunQMake(false), m_linkQmlDebuggingLibrary(DebugLink) { ctor(); @@ -227,8 +228,6 @@ bool QMakeStep::init() QString program = qtVersion->qmakeCommand(); - // Check whether we need to run qmake - m_needToRunQMake = true; QString makefile = workingDirectory; if (qt4bc->subNodeBuild()) { @@ -244,17 +243,18 @@ bool QMakeStep::init() makefile.append("/Makefile"); } + // Check whether we need to run qmake + bool makefileOutDated = true; if (QFileInfo(makefile).exists()) { QString qmakePath = QtSupport::QtVersionManager::findQMakeBinaryFromMakefile(makefile); if (qtVersion->qmakeCommand() == qmakePath) { - m_needToRunQMake = !qt4bc->compareToImportFrom(makefile); + makefileOutDated = !qt4bc->compareToImportFrom(makefile); } } - if (m_forced) { - m_forced = false; + if (m_forced || makefileOutDated) m_needToRunQMake = true; - } + m_forced = false; setEnabled(m_needToRunQMake); ProcessParameters *pp = processParameters(); @@ -309,6 +309,7 @@ void QMakeStep::run(QFutureInterface<bool> &fi) return; } + m_needToRunQMake = false; AbstractProcessStep::run(fi); } @@ -334,7 +335,7 @@ bool QMakeStep::immutable() const void QMakeStep::processStartupFailed() { - m_forced = true; + m_needToRunQMake = true; AbstractProcessStep::processStartupFailed(); } @@ -342,7 +343,7 @@ bool QMakeStep::processSucceeded(int exitCode, QProcess::ExitStatus status) { bool result = AbstractProcessStep::processSucceeded(exitCode, status); if (!result) - m_forced = true; + m_needToRunQMake = true; qt4BuildConfiguration()->emitBuildDirectoryInitialized(); return result; }