Unsolved Qt Creator warning "The build directory needs to be at the same level as the source directory."
-
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)?
-
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.
-
@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 ?
-
@mrjj usually the compiler warnings get controlled from a .pro file. Are you saying that it's also possible to do for the warnings/messages from Qt Creator itself? If yes, how?
Thanks in advance, -
@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.
-
@SGaist I didn't have a chance yet to spend any time with Qt Creator code base. But it looks like a good motivation :) Though I'd appreciate a hint which part of the source tree to start looking at.
-
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; }