Qbs: install files preserving hierarchy

夙愿已清 提交于 2019-12-12 16:43:47

问题


I have directory with files in subdirectories to be deployed with my application (qml plugins). The trouble is: if I try to install dirs:

Group {
    name: "somegroup"
    files: ["mysrc/dir"]
    qbs.install: true
    qbs.installDir: "mybuild"
}

I get a "Not recursively copying directory 'mysrc/dir' into target directory 'mybuild'. Install the individual file artifacts instead." error.

If I try to install files:

Group {
    name: "somegroup"
    files: ["mysrc/dir/**/*"]
    qbs.install: true
    qbs.installDir: "mybuild"
}

Then all of those files go into same directory ignoring hierarchy (and cannot be installed, because some of them share name).

Solution with multiple groups is too verbose either.

Is there a way to install directory with files, recursively, preserving hierarchy?


回答1:


See the qbs.installSourceBase property; that's exactly what it is for.




回答2:


example usage:

Group {
    name: "qt_qml_plugins"
    prefix: Qt.core.pluginPath + "/../qml/"
    files: [
        "QtQml/**",
        "QtQuick/**",
        "QtQuick.2/**",
        "QtPositioning/**",
        "QtLocation/**"
    ]
    excludeFiles: ["**/*d.dll"]
    qbs.install: true
    qbs.installDir: "../../qml"
    qbs.installSourceBase: prefix
}


来源:https://stackoverflow.com/questions/43115652/qbs-install-files-preserving-hierarchy

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!