[Qbs] qbs questions
Jake.Petroules at qt.io
Sat Dec 2 23:03:39 CET 2017
In future please try to direct questions to the Qbs mailing list so all can benefit from and help to answer questions. :)
In Qbs, almost everything is also a "variable", or in Qbs parlance, a module property. You can override these properties on the command line when running a Qbs project. https://doc-snapshots.qt.io/qbs/building-applications.html contains some examples of this.
We also have specific functionality for running tools like static analyzers, ccache, etc., which you can handle by setting the cpp.compilerWrapper property; the values in this property will be prepended to the compiler command line. See http://doc-snapshots.qt.io/qbs/cpp-module.html for documentation on this property.
There's also the generators functionality, where you can write plugins in C++ that allow you to traverse the Qbs build graph as it is executed. This allows things like generating Clang compilation databases. See https://doc-snapshots.qt.io/qbs/generators.html#generating-clang-compilation-databases
So yes, we have plenty of functionality for doing these sorts of things and we'd always love to hear more specific use cases so we can make Qbs flexible enough to cover everyone's needs as much as feasible.
> On Dec 2, 2017, at 12:20 PM, Carlos Mazieri <carlos.mazieri at gmail.com> wrote:
> Hello Jake
> I have few questions regarding QBS,
> What I like in "qmake" is that almost everything is a variable, SOURCES, HEADERS, we can set different compiler versions by setting QMAKE_CXX, etc.
> I am the author of a simple project called QtProjectTool which is pipe for Qmake Qt projects to other command line tools, it integrates command line tools such as "cppcheck", "cpplint" among others in QtCreator acting as an external plugin.
> The QtProjectTool project does not parse qmake project files, instead of this it adds some functions to the project file in order to print the content of some variables using "message()" function, then it runs "qmake" and parse its output to get the SOURCES, HEADERS, DEFINES, INCLUDEPATH among other information.
> Does "QBS" provide a way to other applications extract that kind of information from QBS project files?
> I am looking forward to enhancing QtProjectTool in order to support "QBS" projects as well.
> Thanks in advance,
> Carlos J. Mazieri
Jake Petroules - jake.petroules at qt.io
The Qt Company - Silicon Valley
Qbs build tool evangelist - qbs.io
More information about the Qbs