diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp index aaa024829d9..a5e79be2d66 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp @@ -341,6 +341,14 @@ QmakeBuildConfiguration::MakefileState QmakeBuildConfiguration::compareToImportF BaseQtVersion *version = QtKitInformation::qtVersion(target()->kit()); if (!version) return MakefileForWrongProject; + if (QtSupport::QtVersionManager::makefileIsFor(makefile, qs->project()->projectFilePath()) + != QtSupport::QtVersionManager::SameProject) { + if (debug) { + qDebug() << "different profile used to generate the Makefile:" + << makefile << " expected profile:" << qs->project()->projectFilePath(); + } + return MakefileIncompatible; + } if (version->qmakeCommand() == qmakePath) { // same qtversion QPair result =