[英]For QBS, What parameters would I set in my DynamicLibrary{} to install headers and libraries upon build?
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. 我正在将我的Qt库从qmake迁移到qbs,并且我试图找到一个不错的模板来帮助我了解简化所述库的构建和安装所需的参数。
Currently a qbs file for one of my libraries looks like this: 目前,我的其中一个库的qbs文件如下所示:
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
我只想将标题放在/usr/include/qconsoledesigner
and the .so
libraries installed in /usr/share/qconsoledesigner
以及安装在/usr/share/qconsoledesigner
的.so
库
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 eg http://doc-snapshots.qt.io/qbs/qml-qbsconvenienceitems-dynamiclibrary.html#installDir-prop . 参见例如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. 普通的“ qbs构建”安装到构建目录内的安装根目录中。 To install "globally", follow the "qbs build" with "sudo qbs install --no-build --install-root /". 要“全局”安装,请在“ qbs build”之后加上“ sudo qbs install --no-build --install-root /”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.