[QBS] Project structure

Joerg Bornemann joerg.bornemann at digia.com
Thu May 23 15:51:41 CEST 2013


On 23/05/2013 08:21, Orgad Shaneh wrote:

> The project consists of 2 static libraries (call them lib1 and lib2) and
> a target executable (call it app).
>
> I need some advice regarding the preferred qbs project structure.
>
>  1. lib1 and app share some of the defines and include paths (lib2 is
>     somewhat disjoint).

You might want to add common values into a .js file and use those in 
lib1 and app. Or you add properties to the Project item and reference 
them in lib1 and app.

>  2. I have multiple build variants. All of them are debug builds, but
>     each variant uses a different define and 2 of the variants exclude
>     some of the source files.

Is your question how to define custom build variants?

>  3. I would like to have some sort of configuration that outsources the
>     actual build operation to an external script. I do need though to
>     have defines and include paths correctly parsed (in Creator) and for
>     external builds I also have multiple configurations (some flags are
>     strings, some are booleans). With qmake I use PRE_TARGETDEPS and
>     place the sources in a dummy scope. Is there a way to do this with qbs?

Display-only files for Qt Creator can be put into a Group item with a 
false condition. You can call your build script from a Transformer item. 
See tests/manual/transformers for an example.

>  4. The include paths list is quite long. Is there a way to use a
>     wildcard for it like it is done for sources?

No. But you could generate and load a .js file that contains the include 
paths.


BR,

Joerg




More information about the Qbs mailing list