[QBS] Copying QML files to build directory

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


Hello,

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
Creator:

qbs install --install-root
"/home/fonzi/myproject/MyProject-build/qtc_Desktop_Qt_5_2_0_GCC_64bit-debug"

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
"/home/fonzi/myproject/MyProject-build/qtc_Desktop_Qt_5_2_0_GCC_64bit-debug/home/fonzi/myproject/qml/MyProject"
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.

Thanks!

-Alfonso

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',
        "icon48.ico"]
        excludeFiles: ['**/moc_*.cpp', "test/**/*"]

        // Copy qml files to build dir; does not currently work as
        expected
        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",
        "backend/*.h"]
    }
}



More information about the Qbs mailing list