blob: 991e4ddcb43ba3f246fc25a1fc060e8bd3300507 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
import qbs.Environment
import qbs.FileInfo
import qbs.Utilities
Project {
QtApplication {
name: "app"
Depends { name: "Qt.scxml"; required: false }
Properties {
condition: Qt.scxml.present && Utilities.versionCompare(Qt.core.version, "5.13.0") != 0
cpp.defines: ["HAS_QTSCXML"]
}
Qt.scxml.className: "QbsStateMachine"
Qt.scxml.namespace: "QbsTest"
Qt.scxml.generateStateMethods: true
files: ["main.cpp"]
Group {
files: ["dummystatemachine.scxml"]
fileTags: ["qt.scxml.compilable"]
}
}
Product {
name: "runner"
type: ["runner"]
Depends { name: "app" }
Rule {
inputsFromDependencies: ["application"]
outputFileTags: ["runner"]
prepare: {
var cmd = new Command(input.filePath);
cmd.description = "running " + input.filePath;
var pathVar;
var pathValue;
if (product.qbs.hostOS.contains("windows")) {
pathVar = "PATH";
pathValue = FileInfo.toWindowsSeparators(input["Qt.core"].binPath);
} else {
pathVar = "LD_LIBRARY_PATH";
pathValue = input["Qt.core"].libPath;
}
var oldValue = Environment.getEnv(pathVar) || "";
var newValue = pathValue + product.qbs.pathListSeparator + oldValue;
cmd.environment = [pathVar + '=' + newValue];
return [cmd];
}
}
}
}
|