Qt6 topics merged with General

QBS -> custom toolchain

  • How can one add a custom build toolchain to QBS? As far as I understand this should be possible using a Module. I tried it like this:
    @import qbs 1.0
    import qbs.File
    import qbs.FileInfo
    import qbs.ModUtils

    Module {
    name: "hal"

    FileTagger {
               patterns: ["*.hal"]
               fileTags: ["hal"]
    Rule {
        id: compiler
        inputs: ['hal']
        prepare: {
            var args = [];
            var cmd = new Command("echo", args);
            cmd.description = 'compiling ' + FileInfo.fileName(input.fileName);
            cmd.highlight = 'compiler';
            return cmd;


    @import qbs

    Product {
    name: "testProduct"
    files: ["test.hal", "main.cpp"]

    Group {
        name: "QML files"
        files: ["main.qml"]
        fileTags: ["qml"]
    Depends { name: "hal" }
    FileTagger {
              patterns: "*.qml"
              fileTags: ["qml"]
    Group {     // Properties for qml files
        name: "Install"
        fileTagsFilter: ["hal"]
        qbs.install: true
        qbs.installDir: "/blu/bin"
    qbsSearchPaths: "machinekit"


    Shouldn't this echo all my *.hal files?

    Where can I get more help to QBS in general? The stuff in the documentation is not much at all.


Log in to reply