I am migrating my Qt Libraries over from qmake to qbs, and I am trying to find a decent template that will help me understand what parameters are needed for streamlining the building and installing of said libraries.
Currently a qbs file for one of my libraries looks like this:
import qbs
DynamicLibrary {
name: "qparsingtoolkit";
Depends {name: "cpp"}
Depends {name: "Qt.core"}
files: [
"Headers/qparsingparameters.h",
"Headers/qparsingtoolkit.h",
"Headers/qparsingtoolkit_global.h",
"Sources/qparsingparameters.cpp",
"Sources/qparsingtoolkit.cpp",
]
}
The installation is relatively simple.
I just want a the headers placed in /usr/include/qconsoledesigner
and the .so
libraries installed in
/usr/share/qconsoledesigner
DynamicLibrary {
name: "qparsingtoolkit";
Depends {name: "cpp"}
Depends {name: "Qt.core"}
qbs.installPrefix: "usr"
files: [
"Sources/qparsingparameters.cpp",
"Sources/qparsingtoolkit.cpp",
]
Group {
name: "api_headers"
files: [
"Headers/qparsingparameters.h",
"Headers/qparsingtoolkit.h",
"Headers/qparsingtoolkit_global.h",
]
qbs.install: true
qbs.installDir: "include/qconsoledesigner"
}
Group {
fileTagsFilter: ["dynamiclibrary", "dynamiclibrary_symlink"]
qbs.install: true
qbs.installDir: "share/qconsoledesigner"
}
}
Note that installation of target binaries will become more straightforward in the future; see e.g. http://doc-snapshots.qt.io/qbs/qml-qbsconvenienceitems-dynamiclibrary.html#installDir-prop.
A normal "qbs build" installs into an install root inside the build dir. To install "globally", follow the "qbs build" with "sudo qbs install --no-build --install-root /".