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;