[Qbs] Including project files matching git submodules

Björn Schäpers qt-maillist at hazardy.de
Thu Jan 3 22:14:09 CET 2019


I'm trying to build a repository for multiple libraries and applications, where 
every product is located in an own submodule. Right now I'm at this point:

- all.qbs
- libs/
   - libs.qbs
   - up.qbs
   - lib1/
     - lib1.qbs
   - lib2/
     - lib2.qbs

Lib2 needs lib1. The file contents are as follows (striped to what I think is 

Product {
   name: "Lib1"
   Export { cpp.includePaths: ["./include"] }

Project {
   references: ["../up.qbs"]
   Depends { name: "Lib1" }

Project { references: ["../all.qbs"] }

Project { references: ["libs/libs.qbs"] }

Project { references: ["lib1/lib1.qbs", "lib2/lib2.qbs"] }

Trying to compile lib2 I get the message "Cycle detected while referencing file 
'lib2/lib2.qbs'." And the Include-Path is not added (although QtCreator did find 
the headers for auto completion).

The message is clear, but not how do I solve this problem? I want the libraries 
to be able to use other libraries, without knowing their path, only their name. 
I'm willing to use something like my up.qbs here or maybe a function to filter 
out the current root qbs (in my case lib2.qbs) from the references list, but I 
don't know if this is possible and if how to do it. I have right now no 
experience in QML/JS.

Can anybody help me, or show another solution to my problem?

Many thanks in advance,

More information about the Qbs mailing list