From 77941ef9b3e4b20089cb0841aa47b06e6753095c Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Sun, 10 Jun 2018 08:59:57 +0300 Subject: [PATCH] Qmake: Fix redundant qmake execution for sub-project build When building a sub-project using the context menu -> Build, qmake was executed every time, because the pro file in the Makefile was compared against the root project instead of the sub-project. Change-Id: Id76d7d23e3fa9a8e4c5c10cd10adcc945ff3b186 Reviewed-by: Oswald Buddenhagen Reviewed-by: Tobias Hunger --- src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp index 3fe051f7784..b5f51bc46ff 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp @@ -357,9 +357,11 @@ QmakeBuildConfiguration::MakefileState QmakeBuildConfiguration::compareToImportF return MakefileForWrongProject; } - if (parse.srcProFile() != qs->project()->projectFilePath().toString()) { + const Utils::FileName projectPath = + m_subNodeBuild ? m_subNodeBuild->filePath() : qs->project()->projectFilePath(); + if (parse.srcProFile() != projectPath.toString()) { qCDebug(logs) << "**Different profile used to generate the Makefile:" - << parse.srcProFile() << " expected profile:" << qs->project()->projectFilePath(); + << parse.srcProFile() << " expected profile:" << projectPath; if (errorString) *errorString = tr("The Makefile is for a different project."); return MakefileIncompatible;