[QBS] On the use of "Depends" keyword

NIkolai Marchenko enmarantispam at gmail.com
Thu Sep 3 23:02:23 CEST 2015

Hi! I have a problem/misunderstanding/concern with Depends keyword in qbs.

Lets consider a project like this

-- in project.qbs --
references: ["lib1.qbs", "lib2.qbs"]
--in lib1.qbs --
type: "dynamicLibrary"
name: "lib1"
Depends{name: Qt.core}
//assuming this exports some classes/functions

--in lib2.qbs --
type: "dynamicLibrary"
name: "lib2"
Depends{name: "Qt.core"}
Depends{name: "lib1"}

Ok, first a question: is Depends{name: "lib1"} in lib2.qbs the ONLY way
currently available to enforce lib1 being built before lib2 when
superproject is built?

if the answer is yes, then we have further questions:
Depends{name: "Qt.core"} is telling qbs to make classes from qtcore
available at compile time
Depends{name: "lib1"} is essentially a directve to the compiler to build
lib1 first
Isn't there an ambiguity of usage here?

assuming we are trying to build lib2 via its own .qbs file instead of as a
part of "super"
we will get unresolved lib1 dependency even if lib1 was already compiled
previously and lib1.dll is available.

We can do  Depends{name: "lib1"; required: false} but then, will "super"
enforce lib1 to be compiled first or does required:false breaks this

3) assuming we have a lot of Depends in a file
Depends{name: "lib1"}
Depends{name: "lib2"}
Depends{name: "lib3"}
Depends{name: "lib4"}
Depends{name: "lib5"}

doesn't it look like internal .qbs is stating things for external project
essentially making assumptions about the way this lib is beng built?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20150904/528867be/attachment.html>

More information about the Qbs mailing list