[Qbs] Concatenating include paths with Qbs
Christian Kandeler
christian.kandeler at qt.io
Wed May 24 09:38:21 CEST 2017
On Wed, 24 May 2017 09:10:24 +0200
Timur Kristóf <timur.kristof at gmail.com> wrote:
> I have a Qbs project that contains a static library and an executable
> that depends on the static library. The static library has some
> features which can be enabled or disabled through a couple of bool
> properties. It has a "myIncludes" property which contains the pathList
> of the include paths of its currently enabled features, and the
> executable needs to use these among its include paths.
>
> What is the correct way to do this with Qbs?
A product's properties are "private" in that they are not accessible from other products. You add module properties such as cpp.includePaths to depending products using an Export item:
Product {
name: "ex"
// ...
Export {
Depends { name: "cpp" }
cpp.includePaths: product.myIncludes // "product" refers to the exporting product
}
}
Note that you don't have to do anything in the other product except adding the dependency to "ex".
Hope this helps,
Christian
More information about the Qbs
mailing list