Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Build Qt Qml using Bazel



  • Need help on How to build Qt Qml application using Bazel build. There is a way to incude Qt Widget ui and header, source files in Bazel. But not know how to add qml files in Bazel and build.


  • Lifetime Qt Champion

    Hi,

    Do you mean like show in this example project but adding the QtQuick library ?



  • Hi, Yes, But not sure how to include .qml files in bazel build files as it supports C++.


  • Moderators

    @Gannu-Bangalore said in Build Qt Qml using Bazel:

    Hi, Yes, But not sure how to include .qml files in bazel build files as it supports C++.

    QML is read from disk at runtime. There is no need for a build system to "support" it.

    If you want to bake QML files into your application, then use QRC (Qt Resource System). I don't know bezel but it should have some means of running external tools, right? If so, you can simply write your QRC file and run rcc binary (from QtDirectory/bin folder) on it to generate a c++ file with embedded resources. Then you include that c++ file in your build instructions. Should work :-)



  • Bazel is a build system for Tensorflow code...I am using tensor flow with Qt qml .... so Qt Qml has to be build using bazel...there is method to include cpp files and build ....but there are no instructions how to add qml files in bazel build system for compilation.


  • Moderators

    @Gannu-Bangalore said in Build Qt Qml using Bazel:

    Bazel is a build system for Tensorflow code...I am using tensor flow with Qt qml .... so Qt Qml has to be build using bazel...there is method to include cpp files and build ....but there are no instructions how to add qml files in bazel build system for compilation.

    I just wrote you how to do it... just put that description into practice. If you're fine with reading QML files from your hard drive (that might be a good solution fo a quick start), then you don't need to do anything in bezel. Just point your QQmlEngine to main.qml file, wherever it is on your disk.



  • Thank you Man. Got it :-)


Log in to reply