2023-01-04 17:31:50 +01:00
|
|
|
import qbs.FileInfo
|
2023-01-05 18:01:30 +01:00
|
|
|
import qbs.File
|
2023-01-04 17:31:50 +01:00
|
|
|
|
|
|
|
CppApplication {
|
|
|
|
Depends { name: "buildconfig" }
|
|
|
|
Depends { name: "bundle" }
|
|
|
|
|
|
|
|
Properties {
|
|
|
|
condition: qbs.targetOS.contains("macos")
|
|
|
|
cpp.minimumMacosVersion: buildconfig.minimumMacosVersion
|
|
|
|
}
|
|
|
|
|
2023-01-09 11:16:36 +01:00
|
|
|
Properties {
|
|
|
|
condition: buildconfig.enableRPath
|
|
|
|
cpp.rpaths: FileInfo.joinPaths(cpp.rpathOrigin,
|
|
|
|
"..",
|
|
|
|
qbs.targetOS.contains("macos")
|
|
|
|
? "Frameworks"
|
|
|
|
: buildconfig.installLibraryPath)
|
|
|
|
}
|
|
|
|
|
2023-01-04 17:31:50 +01:00
|
|
|
install: true
|
|
|
|
installDir: buildconfig.installAppPath
|
|
|
|
installDebugInformation: true
|
2023-01-05 18:38:08 +01:00
|
|
|
type: base.concat("testSuit")
|
2023-01-04 17:31:50 +01:00
|
|
|
|
|
|
|
Properties {
|
|
|
|
condition: Qt.core.versionMajor >= 5 && Qt.core.versionMinor < 12
|
|
|
|
cpp.cxxLanguageVersion: "c++11"
|
|
|
|
}
|
|
|
|
// Since Qt 5.12 available support for C++17
|
|
|
|
Properties {
|
|
|
|
condition: Qt.core.versionMajor >= 5 && Qt.core.versionMinor >= 12
|
|
|
|
cpp.cxxLanguageVersion: "c++17"
|
|
|
|
}
|
2023-01-05 18:01:30 +01:00
|
|
|
|
2023-01-05 18:38:08 +01:00
|
|
|
Group {
|
|
|
|
condition: qbs.targetOS.contains("windows") && (qbs.architecture.contains("x86_64") || qbs.architecture.contains("x86"))
|
|
|
|
name: "pdftops"
|
|
|
|
prefix: FileInfo.joinPaths(project.sourceDirectory, "dist", "win", FileInfo.pathSeparator())
|
|
|
|
files: ["pdftops.exe"]
|
|
|
|
fileTags: ["pdftops_dist"]
|
|
|
|
qbs.install: true
|
|
|
|
qbs.installDir: buildconfig.installBinaryPath
|
|
|
|
}
|
|
|
|
|
2023-01-05 18:01:30 +01:00
|
|
|
Group {
|
|
|
|
condition: qbs.targetOS.contains("windows") && (qbs.architecture.contains("x86_64") || qbs.architecture.contains("x86"))
|
|
|
|
name: "openssl"
|
|
|
|
prefix: FileInfo.joinPaths(project.sourceDirectory, "dist", "win", "openssl", FileInfo.pathSeparator())
|
|
|
|
files: {
|
|
|
|
var files = [];
|
|
|
|
// Minimal supported OpenSSL version since Qt 5.12.4 is 1.1.1.
|
|
|
|
if (Qt.core.versionMajor >= 5 && Qt.core.versionMinor >= 12 && Qt.core.versionPatch >= 4) {
|
|
|
|
if (qbs.architecture.contains("x86_64")) {
|
|
|
|
files.push(
|
|
|
|
FileInfo.joinPaths("win64", "libcrypto-1_1-x64.dll"),
|
|
|
|
FileInfo.joinPaths("win64", "libssl-1_1-x64.dll")
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
files.push(
|
|
|
|
FileInfo.joinPaths("win32", "libcrypto-1_1.dll"),
|
|
|
|
FileInfo.joinPaths("win32", "libssl-1_1.dll")
|
|
|
|
);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
files.push("msvcr120.dll");
|
|
|
|
if (qbs.architecture.contains("x86_64")) {
|
|
|
|
files.push(
|
|
|
|
FileInfo.joinPaths("win64", "libeay32.dll"),
|
|
|
|
FileInfo.joinPaths("win64", "ssleay32.dll")
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
files.push(
|
|
|
|
FileInfo.joinPaths("win32", "libeay32.dll"),
|
|
|
|
FileInfo.joinPaths("win32", "ssleay32.dll")
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return files;
|
|
|
|
}
|
|
|
|
fileTags: ["openssl_dist"]
|
|
|
|
qbs.install: true
|
|
|
|
qbs.installDir: buildconfig.installBinaryPath
|
|
|
|
}
|
|
|
|
|
|
|
|
Rule {
|
|
|
|
multiplex: true
|
2023-01-05 18:38:08 +01:00
|
|
|
alwaysRun: true
|
2023-01-05 18:01:30 +01:00
|
|
|
condition: qbs.targetOS.contains("windows") && (qbs.architecture.contains("x86_64") || qbs.architecture.contains("x86"))
|
2023-01-05 18:38:08 +01:00
|
|
|
inputs: ["openssl_dist", "pdftops_dist"]
|
|
|
|
outputFileTags: ["testSuit"]
|
2023-01-05 18:01:30 +01:00
|
|
|
outputArtifacts: {
|
|
|
|
var artifactNames = inputs["openssl_dist"].map(function(file){
|
|
|
|
return FileInfo.joinPaths(product.buildDirectory, file.fileName);
|
|
|
|
});
|
2023-01-05 18:38:08 +01:00
|
|
|
|
|
|
|
artifactNames = artifactNames.concat(inputs["pdftops_dist"].map(function(file){
|
|
|
|
return FileInfo.joinPaths(product.buildDirectory, file.fileName);
|
|
|
|
}));
|
2023-01-05 18:01:30 +01:00
|
|
|
var artifacts = artifactNames.map(function(art){
|
|
|
|
var a = {
|
|
|
|
filePath: art,
|
2023-01-05 18:38:08 +01:00
|
|
|
fileTags: ["testSuit"]
|
2023-01-05 18:01:30 +01:00
|
|
|
}
|
|
|
|
return a;
|
|
|
|
});
|
|
|
|
return artifacts;
|
|
|
|
}
|
|
|
|
prepare: {
|
|
|
|
var cmd = new JavaScriptCommand();
|
2023-01-05 18:38:08 +01:00
|
|
|
cmd.description = "Preparing test suit";
|
|
|
|
|
|
|
|
var sources = inputs["openssl_dist"].map(function(artifact) {
|
|
|
|
return artifact.filePath;
|
|
|
|
});
|
|
|
|
|
|
|
|
sources = sources.concat(inputs["pdftops_dist"].map(function(artifact) {
|
|
|
|
return artifact.filePath;
|
|
|
|
}));
|
|
|
|
|
|
|
|
cmd.sources = sources;
|
|
|
|
cmd.destination = outputs["testSuit"].map(function(artifact) {
|
|
|
|
return artifact.filePath;
|
|
|
|
});
|
2023-01-05 18:01:30 +01:00
|
|
|
cmd.sourceCode = function() {
|
|
|
|
for (var i in sources) {
|
|
|
|
File.copy(sources[i], destination[i]);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
return [cmd];
|
|
|
|
}
|
|
|
|
}
|
2023-01-04 17:31:50 +01:00
|
|
|
}
|