Qt Creator warning "The build directory needs to be at the same level as the source directory."
-
Hi, I've also got that warning after upgrading, I've managed to turn it off by exiting Qt Creator, deleting the .pro.user file for my project, starting Qt Creator again (and reselecting the compiler).
@hskoglund Unfortunately it doesn't help in our case - before full build we delete everything, including .pro.user files (so every time the project tree looks exactly as it was retrieved from source control).
-
Hi
It comes from using Shadow Build folder. qmake will fail in rare cases when
build folder is in wrong nesting level. There is no way to disable it unless you
follow the rule. :)I also wish they added a .pro key to disable this warning as i can with most others messages.
-
Ok, so as part of your build you generate fresh .pro.user files as well (i.e. not picking up/storing any .pro.user files in your source control)?
@hskoglund We do not check-in any user-specific files such as .pro.user, and Qt Creator does generate fresh copy because we delete it every time before full clean build. But .pro.user itself has nothing to do with the warning. It's caused by location of our Shadow Build root. https://bugreports.qt.io/browse/QTCREATORBUG-16616 explains the story.
-
Just one philosophical question (and there's no hidden motivation for a flamewar): AFAIU, a zero warning policy should apply to the active building of your project, correct ? What you have here is an IDE only warning that you wouldn't get from your CI server thus, does it really interfere with your policy ?
-
Hi
It comes from using Shadow Build folder. qmake will fail in rare cases when
build folder is in wrong nesting level. There is no way to disable it unless you
follow the rule. :)I also wish they added a .pro key to disable this warning as i can with most others messages.
-
Just one philosophical question (and there's no hidden motivation for a flamewar): AFAIU, a zero warning policy should apply to the active building of your project, correct ? What you have here is an IDE only warning that you wouldn't get from your CI server thus, does it really interfere with your policy ?
@SGaist There are no problems on the build server (otherwise it would've been a shipping blocker, yikes).
But our policy requires devs to have a clean build before commit, and usually it's done from the IDE. Once we learn to ignore one warning, it becomes much easier to overlook another (the relevant) one. The risk of build breaks goes up. -
I completely see your point.
Then it would likely make sense to add a disabler to Qt Creator in e.g. Build And Run even though you'd like to avoid build Qt Creator yourself. You could even submit it for inclusion.
-
I completely see your point.
Then it would likely make sense to add a disabler to Qt Creator in e.g. Build And Run even though you'd like to avoid build Qt Creator yourself. You could even submit it for inclusion.
-
The Project Explorer plugins is likely the place you will be interested in.
-
Hi
It seems to be here.
\src\plugins\qtsupport\baseqtversion.cpp" LINE 1336QList<Task> BaseQtVersion::reportIssuesImpl(const QString &proFile, const QString &buildDir) const { ... QString sourcePath = QFileInfo(proFile).absolutePath(); const QChar slash = QLatin1Char('/'); if (!sourcePath.endsWith(slash)) sourcePath.append(slash); if (tmpBuildDir.count(slash) != sourcePath.count(slash)) { const QString msg = QCoreApplication::translate("QmakeProjectManager::QtVersion", "The build directory needs to be at the same level as the source directory."); results.append(Task(Task::Warning, msg, FileName(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); } return results; }