2023-02-28 09:46:31 +01:00
|
|
|
import qbs.FileInfo
|
|
|
|
|
2023-02-24 13:36:40 +01:00
|
|
|
import "qbs/imports/conan/ConanfileProbe.qbs" as ConanfileProbe
|
2023-02-13 18:59:07 +01:00
|
|
|
|
2023-01-04 17:31:50 +01:00
|
|
|
Project {
|
|
|
|
name: "Valentina"
|
2024-03-12 15:39:44 +01:00
|
|
|
minimumQbsVersion: "1.22"
|
2023-08-29 15:08:59 +02:00
|
|
|
qbsModuleProviders: ["Qt", "conan", "qbspkgconfig"]
|
2023-02-13 18:59:07 +01:00
|
|
|
|
|
|
|
property bool enableConan: false
|
2024-03-12 15:39:44 +01:00
|
|
|
property bool conanWithXerces: false
|
|
|
|
property bool conanWithCrashReporting: false
|
2024-03-21 14:21:45 +01:00
|
|
|
property string conanRemote
|
2023-02-20 14:50:23 +01:00
|
|
|
property string minimumMacosVersion: undefined
|
2024-01-23 14:57:23 +01:00
|
|
|
property string minimumQtVersion: "5.15"
|
2023-02-25 09:26:21 +01:00
|
|
|
property stringList conanProfiles: []
|
2023-08-18 13:01:03 +02:00
|
|
|
property bool enableSigning: true
|
2023-02-13 18:59:07 +01:00
|
|
|
|
2023-02-24 13:36:40 +01:00
|
|
|
// Temporary probe until qbs doesn't support conan 2.0
|
|
|
|
ConanfileProbe {
|
2023-02-13 18:59:07 +01:00
|
|
|
id: thirdPartyConanPackages
|
2024-03-12 15:39:44 +01:00
|
|
|
condition: enableConan && (conanWithXerces || conanWithCrashReporting)
|
2023-02-20 15:40:38 +01:00
|
|
|
conanfilePath: project.sourceDirectory + "/conanfile.py"
|
2023-02-20 20:15:49 +01:00
|
|
|
verbose: true
|
2023-02-25 09:26:21 +01:00
|
|
|
profiles: conanProfiles
|
2024-03-21 14:21:45 +01:00
|
|
|
remote: conanRemote
|
2024-03-12 15:39:44 +01:00
|
|
|
options: {
|
|
|
|
var o = {};
|
|
|
|
if (conanWithXerces)
|
|
|
|
o.with_xerces = "True";
|
|
|
|
|
|
|
|
if (conanWithCrashReporting)
|
|
|
|
o.with_crash_reporting = "True";
|
|
|
|
return o;
|
|
|
|
}
|
2023-02-13 18:59:07 +01:00
|
|
|
}
|
|
|
|
|
2023-01-04 17:31:50 +01:00
|
|
|
references: [
|
|
|
|
"src/src.qbs",
|
2023-01-12 17:33:39 +01:00
|
|
|
"share/translations/translations.qbs",
|
2024-01-24 10:22:01 +01:00
|
|
|
"dmg.qbs",
|
|
|
|
"winsetup.qbs"
|
2023-01-04 17:31:50 +01:00
|
|
|
]
|
|
|
|
qbsSearchPaths: "qbs"
|
|
|
|
|
2023-02-16 19:01:38 +01:00
|
|
|
AutotestRunner {
|
|
|
|
Depends { name: "buildconfig" }
|
|
|
|
|
2023-08-14 06:32:48 +02:00
|
|
|
arguments: ["-silent"]
|
2023-02-28 13:42:02 +01:00
|
|
|
|
2023-02-16 19:01:38 +01:00
|
|
|
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");
|
|
|
|
}
|
2023-02-27 11:04:44 +01:00
|
|
|
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) {
|
2023-03-04 08:21:22 +01:00
|
|
|
var pluginsPath = "QT_QPA_PLATFORM_PLUGIN_PATH=" + FileInfo.joinPaths(Qt.core.pluginPath, "platforms")
|
2023-02-27 11:04:44 +01:00
|
|
|
env.push(pluginsPath);
|
|
|
|
}
|
|
|
|
|
|
|
|
console.info("env_after: " + env);
|
|
|
|
}
|
2023-02-16 19:01:38 +01:00
|
|
|
return env;
|
|
|
|
}
|
|
|
|
}
|
2023-01-04 17:31:50 +01:00
|
|
|
}
|