Linux crash (#9)

* Qbs build: correct rpath for conan libraries

Libraries managed with conan are now downloaded in dynamic. They are
also installed in the build directory.
This directory path is also added to all the applications rpaths.
This ensure that the application loads the correct library.

* Qbs build: correct rpath for conan libraries

Libraries managed with conan are now downloaded in dynamic. They are
also installed in the build directory.
This directory path is also added to all the applications rpaths.
This ensure that the application loads the correct library.
This commit is contained in:
raphaelcotty 2022-01-09 17:26:42 +01:00 committed by GitHub
parent 7a0007100d
commit e8066dd330
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 16 deletions

5
.gitignore vendored
View File

@ -1,7 +1,2 @@
*.pro.user
*.qbs.user
conan.lock
conanbuildinfo.qbs
conanbuildinfo.txt
conaninfo.txt
graph_info.json

View File

@ -1,9 +1,11 @@
import qbs
import qbs.FileInfo
import qbs.Probes
Project {
name: "Pdf4Qt"
qbsSearchPaths: ["qbs"]
property string conanLibDirectory: FileInfo.joinPaths(conan.generatedFilesPath, "lib")
Probes.ConanfileProbe {
id: conan
@ -14,21 +16,40 @@ Project {
references: {
var ref = ["Pdf4QtLib/Pdf4QtLib.qbs",
"Pdf4QtViewer/Pdf4QtViewer.qbs",
"Pdf4QtViewerLite/Pdf4QtViewerLite.qbs",
"CodeGenerator/CodeGenerator.qbs",
"JBIG2_Viewer/JBIG2_Viewer.qbs",
"Pdf4QtDocPageOrganizer/Pdf4QtDocPageOrganizer.qbs",
"Pdf4QtDocDiff/Pdf4QtDocDiff.qbs",
"Pdf4QtViewerPlugins/AudioBookPlugin/AudioBookPlugin.qbs",
"Pdf4QtViewerPlugins/DimensionsPlugin/DimensionsPlugin.qbs",
"Pdf4QtViewerPlugins/OutputPreviewPlugin/OutputPreviewPlugin.qbs",
"Pdf4QtViewerPlugins/RedactPlugin/RedactPlugin.qbs",
"Pdf4QtViewerPlugins/SoftProofingPlugin/SoftProofingPlugin.qbs",
"Pdf4QtViewerProfi/Pdf4QtViewerProfi.qbs",
"PdfExampleGenerator/PdfExampleGenerator.qbs",
"PdfTool/PdfTool.qbs",
"UnitTests/UnitTests.qbs"];
];
ref.push(conan.generatedFilesPath + "/conanbuildinfo.qbs");
return ref;
}
SubProject {
filePath: "Pdf4QtViewerProfi/Pdf4QtViewerProfi.qbs"
}
SubProject {
filePath: "CodeGenerator/CodeGenerator.qbs"
}
SubProject {
filePath: "JBIG2_Viewer/JBIG2_Viewer.qbs"
}
SubProject {
filePath: "Pdf4QtDocPageOrganizer/Pdf4QtDocPageOrganizer.qbs"
}
SubProject {
filePath: "Pdf4QtViewerLite/Pdf4QtViewerLite.qbs"
}
SubProject {
filePath: "Pdf4QtDocDiff/Pdf4QtDocDiff.qbs"
}
SubProject {
filePath: "PdfExampleGenerator/PdfExampleGenerator.qbs"
}
SubProject {
filePath: "PdfTool/PdfTool.qbs"
}
SubProject {
filePath: "UnitTests/UnitTests.qbs"
}
}

View File

@ -4,8 +4,21 @@ freetype/2.11.0
libjpeg/9c
openjpeg/2.4.0
lcms/2.12
libpng/1.6.37
[generators]
qbs
[options]
openssl:shared=True
freetype:shared=True
libjpeg:shared=True
openjpeg:shared=True
lcms:shared=True
libpng:shared=True
[imports]
bin, *.dll -> ./bin # Copies all dll files from packages bin folder to my "bin" folder
lib, *.dylib* -> ./lib # Copies all dylib files from packages lib folder to my "lib" folder
lib, *.so* -> ./lib # Copies all so files from packages lib folder to my "lib" folder

View File

@ -3,7 +3,7 @@ import qbs.FileInfo
Pdf4QtProduct {
Depends { name: "cpp" }
type: "application"
cpp.rpaths: FileInfo.joinPaths(cpp.rpathOrigin, "..", "lib")
cpp.rpaths: [FileInfo.joinPaths(cpp.rpathOrigin, "..", "lib"), conanLibDirectory]
Depends { name: "Pdf4QtLib" }
Group {
@ -14,4 +14,3 @@ Pdf4QtProduct {
}
targetInstallDir: pdf4qtbuildconfig.appInstallDir
}