-
Notifications
You must be signed in to change notification settings - Fork 0
/
valentina.qbs
97 lines (82 loc) · 2.99 KB
/
valentina.qbs
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import qbs.FileInfo
import "qbs/imports/conan/ConanfileProbe.qbs" as ConanfileProbe
Project {
name: "Valentina"
minimumQbsVersion: "1.22"
qbsModuleProviders: ["Qt", "conan", "qbspkgconfig"]
property bool enableConan: false
property bool conanWithXerces: false
property bool conanWithCrashReporting: false
property string conanRemote
property string minimumMacosVersion: undefined
property string minimumQtVersion: "5.15"
property stringList conanProfiles: []
property bool enableSigning: true
// Temporary probe until qbs doesn't support conan 2.0
ConanfileProbe {
id: thirdPartyConanPackages
condition: enableConan && (conanWithXerces || conanWithCrashReporting)
conanfilePath: project.sourceDirectory + "/conanfile.py"
verbose: true
profiles: conanProfiles
remote: conanRemote
options: {
var o = {};
if (conanWithXerces)
o.with_xerces = "True";
if (conanWithCrashReporting)
o.with_crash_reporting = "True";
return o;
}
}
references: [
"src/src.qbs",
"share/translations/translations.qbs",
"dmg.qbs",
"winsetup.qbs"
]
qbsSearchPaths: "qbs"
AutotestRunner {
Depends { name: "buildconfig" }
arguments: ["-silent"]
environment: {
var env = base;
if (qbs.targetOS.contains("unix") && !qbs.targetOS.contains("macos")) {
env.push("LD_LIBRARY_PATH=" + qbs.installRoot + qbs.installPrefix + "/" + buildconfig.libDirName + "/valentina");
}
else if (qbs.targetOS.contains("windows")) {
// PATH
var path = "";
for (var i = 0; i < env.length; ++i) {
if (env[i].startsWith("PATH=")) {
path = env[i].substring(5);
break;
}
}
var fullInstallDir = FileInfo.joinPaths(qbs.installRoot, qbs.installPrefix);
if (path.length === 0) {
path = fullInstallDir;
} else {
path = fullInstallDir + ";" + path;
}
var arrayElem = "PATH=" + path;
if (i < env.length)
env[i] = arrayElem;
else
env.push(arrayElem);
// QT_QPA_PLATFORM_PLUGIN_PATH
for (var i = 0; i < env.length; ++i) {
if (env[i].startsWith("QT_QPA_PLATFORM_PLUGIN_PATH=")) {
break;
}
}
if (i >= env.length) {
var pluginsPath = "QT_QPA_PLATFORM_PLUGIN_PATH=" + FileInfo.joinPaths(Qt.core.pluginPath, "platforms")
env.push(pluginsPath);
}
console.info("env_after: " + env);
}
return env;
}
}
}