diff options
Diffstat (limited to 'src/plugins/qt4projectmanager/qtversionmanager.cpp')
-rw-r--r-- | src/plugins/qt4projectmanager/qtversionmanager.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/plugins/qt4projectmanager/qtversionmanager.cpp b/src/plugins/qt4projectmanager/qtversionmanager.cpp index 02246c7c98..33b3102496 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.cpp +++ b/src/plugins/qt4projectmanager/qtversionmanager.cpp @@ -638,10 +638,14 @@ bool QtVersion::supportsShadowBuilds() const } QList<ProjectExplorer::Task> -QtVersion::reportIssues(const QString &proFile) +QtVersion::reportIssues(const QString &proFile, const QString &buildDir) { QList<ProjectExplorer::Task> results; + QString tmpBuildDir = buildDir; + if (!buildDir.endsWith(QChar('/'))) + tmpBuildDir.append(QChar('/')); + if (!isValid()) { //: %1: Reason for being invalid const QString msg = QCoreApplication::translate("Qt4ProjectManager::QtVersion", "The Qt version is invalid: %1").arg(invalidReason()); @@ -659,6 +663,22 @@ QtVersion::reportIssues(const QString &proFile) QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); } + QString sourcePath = QFileInfo(proFile).absolutePath(); + if (!sourcePath.endsWith(QChar('/'))) + sourcePath.append(QChar('/')); + + if ((tmpBuildDir.startsWith(sourcePath)) && (tmpBuildDir != sourcePath)) { + const QString msg = QCoreApplication::translate("Qt4ProjectManager::QtVersion", + "Qmake does not support build directories below the source directory."); + results.append(ProjectExplorer::Task(ProjectExplorer::Task::Warning, msg, QString(), -1, + QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); + } else if (tmpBuildDir.count(QChar('/')) != sourcePath.count(QChar('/'))) { + const QString msg = QCoreApplication::translate("Qt4ProjectManager::QtVersion", + "The build directory needs to be at the same level as the source directory."); + results.append(ProjectExplorer::Task(ProjectExplorer::Task::Warning, msg, QString(), -1, + QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); + } + QSet<QString> targets = supportedTargetIds(); if (targets.contains(Constants::S60_DEVICE_TARGET_ID) || targets.contains(Constants::S60_EMULATOR_TARGET_ID)) |