2

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?

Jake Petroules
  • 23,472
  • 35
  • 144
  • 225
Andrei R.
  • 2,374
  • 1
  • 13
  • 27

2 Answers2

3

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

Ignitor
  • 2,907
  • 33
  • 50
Jake Petroules
  • 23,472
  • 35
  • 144
  • 225
1

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
}
Andrei R.
  • 2,374
  • 1
  • 13
  • 27