[Qbs] Qbs, generators and automating tedious tasks

Jakub Narolewski izowiuz at gmail.com
Mon Nov 13 18:46:55 CET 2017


Let me start by saying that I am not, by any means, a long time user of Qbs and maybe there is something painfully obvious that I missed which can be used to resolve my situation.

Some time ago I started researching ways in which Qbs could help me integrate awesome tools from clang land into my dev workflow.
Many of them [clang-tidy, KDAB’s clazy, even cppcheck] can leverage compile commands json file to do all sorts of static analysis. 

To quote the documentation:
“To generate a project for another build system, such as Microsoft Visual Studio, use the qbs-generate sub-command and specify a generator using the -g option.
# For Visual Studio
qbs generate -g visualstudio2015”

Obviously, when I use QtCreator to manage my Qbs projects, inputting this command into powershell/cmd leads to errors related to not yet configured Qbs profile and Qt framework instance. I could probably add them by hand and be done with it BUT:

1. I often change Qt versions
2. I often change compilers and their versions
3. I often change my workstations
4. I am an extremely lazy person

I already tried adding custom build step in QtCreator but this is suboptimal. In ideal world I would right click on a Qbs project in QtCreator treeview and select “Generate project files for- > clangdb, vsstudioXXXX, turboC++” or maybe add some custom module in *.qbs file to generate it during build time.

Is there any sane way to deal with this?

Jakub Narolewski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20171113/941704a5/attachment.html>

More information about the Qbs mailing list