[Qbs] Products with Space in Name

Christian Kandeler christian.kandeler at qt.io
Fri Jun 26 13:42:27 CEST 2020


On Fri, 26 Jun 2020 13:14:11 +0200
Björn Schäpers <qt-maillist at hazardy.de> wrote:

> DynamicLibrary {
>     name: "FooBar"
> }
> 
> CppApplication {
>     Depends { name: "cpp" }
>     Depends { name: "FooBar" }
>     cpp.defines = ["FOO_PATH=\"" + FooBar.buildDirectory + "\""]

Eww... This works? You cannot rely on that, these properties are conceptually private. Please use exports instead:

DynamicLibrary {
    name: "FooBar"
    Export { property string theDir: product.buildDirectory }
}

CppApplication {
    Depends { name: "cpp" }
    Depends { name: "FooBar" }
    cpp.defines = ["FOO_PATH=\"" + FooBar.theDir + "\""]
}

> Does not work:
> DynamicLibrary {
>     name: "Foo Bar"
> }
> 
> CppApplication {
>     Depends { name: "cpp" }
>     Depends { name: "Foo Bar" }

Depends { name: "Foo Bar"; id: foobar }
cpp.defines = ["FOO_PATH=\"" + foobar.buildDirectory + "\""]


Christian


More information about the Qbs mailing list