[QBS] Copying QML files to build directory

achartier at fastmail.fm achartier at fastmail.fm
Thu Dec 26 19:21:09 CET 2013


I am having some difficulty getting qbs to copy my QML and image
resource files to the output directory. I have followed the directions
as described here
(http://qt-project.org/doc/qbs-1.1/installing-files.html) and have
created a Group element and added the following deploy step to Qt

qbs install --install-root

According to the documentation, the folder I specify for qbs.installDir
should be relative to the folder specified above for the --install-root
argument. This does not seem to be the case. The files are being
installed to
instead. Furthermore, for some reason, only the .png files are being
copied over; no qml files are being copied, even though they are
specified in the Group element's files property.

I have included my project file below. Any help is greatly appreciated.
FYI, I am using Qt Creator 3.0 and Qt 5.2.



import qbs 1.0

Project {
    property string name: 'MyProject'

    Product {
        id: product
        name: project.name
        type: "application"

        Depends { name: "cpp" }
        Depends { name: "Qt.gui" }
        Depends { name: "Qt.qml" }
        Depends { name: "Qt.quick" }

        cpp.cxxFlags: "-std=c++0x"

        files: ['**/*.qml', '**/*.js', '**/*.cpp', '**/*.h',
        excludeFiles: ['**/moc_*.cpp', "test/**/*"]

        // Copy qml files to build dir; does not currently work as
        Group {
            name: "QML Resources"
            files: ["**/*.png", "**/*.qml"]
            qbs.install: true
            qbs.installDir: "qml/MyProject"

    Product {
        id: unitTests
        name: "unitTests"
        type: "application"

        Depends { name: "cpp" }
        Depends { name: "Qt.test" }

        cpp.cxxFlags: "-std=c++0x"

        files: ["test/unit/*.cpp", "test/unit/*.h", "backend/*.cpp",

More information about the Qbs mailing list