[QBS] Just a few questions
Christian Kandeler
christian.kandeler at digia.com
Wed May 28 17:13:32 CEST 2014
On 05/28/2014 04:13 PM, Kevin Chaves wrote:
>> That is certainly unexpected. If you can reproduce, please file a bug
>> with a minimal example and the steps to trigger it. It does not happen
>> for me.
>
> I'll see if i can reproduce it on a smaller scale. There is a very large stack of subprojects.
> I imagine that might have something to do with it.
>
> On another note, is it possible to define a produce type, like StaticLib,
> we have a few libraries i want to apply this template to now.
Yes, you create a file called <item name>.qbs and put it in a directory
called "imports". The parent directory of this one needs to be in
project.qbsSearchPaths. Then you can import and use the item. For instance:
<project dir>/qbs/imports/MyItem.qbs:
import qbs
Product {
type: "mytype"
}
<project dir>/project.qbs:
import qbs
Project {
qbsSearchPaths: "[qbs]"
references: "product.qbs" // Product needs to be in different file,
because imports are resolved before evaluating properties.
}
<project dir>/product.qbs:
import qbs
import MyItem
MyItem {
}
Christian
>
> import qbs
>
> StaticLibrary {
> name: "qwt"
>
> Depends { name: "Qt.core" }
> property string qmakePath: Qt.core.binPath + "/qmake"
> property string proPath: path
>
> Transformer {
> Artifact {
> fileName: "libqwt.a"
> fileTags: "staticlibrary"
> }
>
> prepare:
> {
> var qmakeCmd = new Command(product.qmakePath, ["-r", product.proPath]);
> qmakeCmd.description = "qmake";
> qmakeCmd.workingDirectory = product.buildDirectory + product.name;
>
> var makeCmd = new Command("make", ["-s"]);
> makeCmd.description = "make";
> makeCmd.workingDirectory = qmakeCmd.workingDirectory;
>
> return [qmakeCmd, makeCmd];
> }
> }
>
> Export{
> Depends { name: "cpp" }
> cpp.includePaths: "src"
> }
> }
>
More information about the Qbs
mailing list