[QBS] Project configuration from within qbs profile

Richard Weickelt richard at weickelt.de
Sat Jul 19 16:26:49 CEST 2014


Hi,

I have a question regarding project configuration. A qbs project defines a
property "myProperty". I can of course set the property in the qbs file
itself and I can set the property on command line via:

  qbs build myproject.qbs project.myProperty:bla

Would it also be possible to set this property in a qbs profile? That is
because I have multiple projects which should be compiled with the same
value for "myProperty".

After some investigation I guess that project-specific settings are not
supposed to go into the profile. Should I create a module for that? Is it
possible to set a module's properties in a qbs profile?

Ok, I've tried to create a module "MyModule" and access one of its
properties, but failed:

---- mymodule.qbs ----
    import qbs.base 1.0

    Module
    {
        name: "MyModule"
        property string myProperty
    }

---- myproject.qbs ----
    import qbs.base 1.0
    import "mymodule.qbs" as MyModule

    Product {
        // ...

        Depends { name: "MyModule" }
        property string productProperty: MyModule.myProperty

        // ...

    }

This results in : myproject.qbs:4:1 Product dependency 'MyModule' not found.

I've also tried to create a subfolder and load the module from there as it
has been advised in the QML documentation, without luck. Maybe I make a
general mistake here. These are my first steps with qbs and QML so I'm not
too familiar with the module concept, yet.

Thanks
Richard



More information about the Qbs mailing list