Re: [Qbs] Products with Space in Name

2020-06-26 Thread Björn Schäpers

Am 26.06.2020 um 13:42 schrieb Christian Kandeler:

On Fri, 26 Jun 2020 13:14:11 +0200
Björn Schäpers  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:


Yeah just realized it does not work, before that I only tested with 
product.buildDirectory.




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


Thanks,
Björn.

___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs


Re: [Qbs] Products with Space in Name

2020-06-26 Thread Christian Kandeler
On Fri, 26 Jun 2020 13:14:11 +0200
Björn Schäpers  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
___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs