[QBS] Project configuration from within qbs profile

Christian Kandeler christian.kandeler at digia.com
Mon Jul 21 10:39:04 CEST 2014


On 07/21/2014 09:24 AM, Richard Weickelt wrote:
> It took me a while, but after looking at some qbs projects in the www, I got
> my head around this. Please correct me if I am wrong.
>
> Qbs modules are not a QML language feature, so the import statement is
> useless here.

Right. Modules are known automatically and get pulled in via a "Depends" 
item.

> Instead, they seem to be loaded via some magic background
> functionality. For custom modules in a project, one is supposed to create a
> subfolder with the following layout:
>
> project-folder
> +--subfolder e.g. 'qbs'
> |  +--'modules' folder
> |     +--folder with module-name, e.g. 'myModule'
> |        (name is important here)
> |        +--.qbs file containing the module definition
> |           (name does not matter)
> |
> +--.qbs project file which defines qbsSearchPaths : "qbs"
>
> In the project file one would now write 'Depends { name: "myModule" }' to
> load the module. Then one can access its properties as expected.

Correct. Or, if it is not project-specific, the qbsSearchPaths property 
can go under the "preferences" part of your configuration (globally or 
per profile).

> The documentation mentions 'Depends' and 'qbsSearchPaths', but the missing
> link was the folder layout and naming.

Hm, yes, that seems to be missing. You could file a bug report.

> Once I got modules working, the rest was easy. Module properties can be set
> in a qbs profile and then accessed from within the qbs project file.

Ok, good to hear.


Christian




More information about the Qbs mailing list