* Add conan support

* Windows Qbs port using conan

* Correct QT_INSTALL_DIRECTORY define

* Correct QT_INSTALL_DIRECTORY define, again
This commit is contained in:
raphaelcotty 2021-12-13 12:04:18 +01:00 committed by GitHub
parent f355fe545b
commit 75d40806ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 92 additions and 27 deletions

7
.gitignore vendored
View File

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

View File

@ -1,24 +1,34 @@
import qbs
import qbs.Probes
Project {
name: "Pdf4Qt"
qbsSearchPaths: ["qbs"]
references: [
"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",
]
Probes.ConanfileProbe {
id: conan
conanfilePath: project.sourceDirectory + "/conanfile.txt"
generators: "qbs"
}
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;
}
}

View File

@ -8,4 +8,5 @@ Pdf4QtApp {
]
cpp.includePaths: ["."]
Depends { name: "Qt"; submodules: ["widgets"] }
Depends { name: "Qt.winextras"; condition: qbs.hostOS.contains("windows") }
}

View File

@ -4,10 +4,10 @@ Pdf4QtLibrary {
name: "Pdf4QtLib"
Depends { name: "Qt"; submodules: ["core", "gui", "widgets", "xml"] }
Depends { name: "openssl" }
Depends { name: "freetype2" }
Depends { name: "freetype" }
Depends { name: "libjpeg" }
Depends { name: "libopenjp2" }
Depends { name: "lcms2" }
Depends { name: "openjpeg" }
Depends { name: "lcms" }
Depends {
condition: qbs.toolchain.contains("gcc")
name: "tbb"
@ -16,6 +16,12 @@ Pdf4QtLibrary {
condition: qbs.hostOS.contains("linux")
name: "fontconfig"
}
Properties {
condition: qbs.hostOS.contains("windows")
cpp.defines: "PDF4QTLIB_LIBRARY"
cpp.cxxFlags: "/bigobj"
}
files: [
"sources/*.cpp",
"sources/*.h",
@ -27,10 +33,10 @@ Pdf4QtLibrary {
Depends { name: "Qt"; submodules: ["core", "gui", "widgets", "xml"] }
cpp.includePaths: ["sources"]
Depends { name: "openssl" }
Depends { name: "freetype2" }
Depends { name: "freetype" }
Depends { name: "libjpeg" }
Depends { name: "libopenjp2" }
Depends { name: "lcms2" }
Depends { name: "openjpeg" }
Depends { name: "lcms" }
Depends {
condition: qbs.toolchain.contains("gcc")
name: "tbb"

View File

@ -1,3 +1,5 @@
import qbs.Utilities
Pdf4QtLibrary {
name: "Pdf4QtViewer"
files: [
@ -7,12 +9,22 @@ Pdf4QtLibrary {
"pdf4qtviewer.qrc",
]
cpp.includePaths: ["."]
cpp.defines: ['QT_INSTALL_DIRECTORY=""']
Properties {
condition: qbs.hostOS.contains("windows")
cpp.defines: ["PDF4QTVIEWER_LIBRARY", "QT_INSTALL_DIRECTORY=" + Utilities.cStringQuote(Qt.core.binPath)]
}
Properties {
condition: qbs.hostOS.contains("linux")
cpp.defines: ["QT_INSTALL_DIRECTORY=" + Utilities.cStringQuote(Qt.core.binPath)]
}
cpp.defines: base.concat(["QT_INSTALL_DIRECTORY=" + Utilities.cStringQuote(Qt.core.binPath)])
Depends { name: "Qt"; submodules: ["printsupport", "texttospeech", "network", "xml"] }
Depends { name: "Qt.winextras"; condition: qbs.hostOS.contains("windows") }
Depends { name: "Pdf4QtLib" }
Export {
Depends { name: "cpp" }
cpp.includePaths: ["."]
Depends { name: "Pdf4QtLib" }
Depends { name: "Qt.winextras"; condition: qbs.hostOS.contains("windows") }
}
}

View File

@ -8,4 +8,8 @@ Pdf4QtPlugin {
"*.ui",
"icons.qrc",
]
Properties {
condition: qbs.hostOS.contains("windows")
cpp.defines: "AUDIOBOOKPLUGIN_LIBRARY"
}
}

View File

@ -8,4 +8,8 @@ Pdf4QtPlugin {
"*.ui",
"icons.qrc",
]
Properties {
condition: qbs.hostOS.contains("windows")
cpp.defines: "DIMENTIONPLUGIN_LIBRARY"
}
}

View File

@ -9,4 +9,8 @@ Pdf4QtPlugin {
"icons.qrc",
]
cpp.includePaths: ["."]
Properties {
condition: qbs.hostOS.contains("windows")
cpp.defines: "OUTPUTPREVIEWPLUGIN_LIBRARY"
}
}

View File

@ -9,4 +9,8 @@ Pdf4QtPlugin {
"icons.qrc",
]
cpp.includePaths: ["."]
Properties {
condition: qbs.hostOS.contains("windows")
cpp.defines: "REDACTPLUGIN_LIBRARY"
}
}

View File

@ -9,4 +9,8 @@ Pdf4QtPlugin {
"icons.qrc",
]
cpp.includePaths: ["."]
Properties {
condition: qbs.hostOS.contains("windows")
cpp.defines: "SOFTPROOFINGPLUGIN_LIBRARY"
}
}

11
conanfile.txt Normal file
View File

@ -0,0 +1,11 @@
[requires]
openssl/1.1.1l
freetype/2.11.0
libjpeg/9c
openjpeg/2.4.0
lcms/2.12
[generators]
qbs
[options]

View File

@ -2,7 +2,7 @@ Product {
Depends { name: "pdf4qtbuildconfig" }
Depends { name: "cpp" }
Depends { name: "Qt.core" }
cpp.cxxLanguageVersion: "c++2a"
cpp.cxxLanguageVersion: "c++20"
property bool install: true
property string targetInstallDir
}