- Qt 6.11
- Qt Qml
- CMake Global Variables in Qt6 Qml
- QT_QML_NO_CACHEGEN
- Qt 6.11.2 Reference Documentation

# QT_QML_NO_CACHEGEN

Disables compilation of QML files into bytecode or C++ code.

This variable was introduced in Qt 6.8.1.

`QT_QML_NO_CACHEGEN` is a CMake variable that can be set to disable the compilation of QML files into bytecode or C++ code for QML targets created by qt6_add_qml_module().

It has the same effect as setting the `NO_CACHEGEN` option of qt6_add_qml_module(), but allows doing so on a per-directory or project basis.

Turn on this option to reduce the number of build steps necessary to complete a build, and thereby shorten the develop-debug iteration cycle.

To minimize application size, turn off this option, and instead use QT_DISCARD_FILE_CONTENTS to remove the QML files embedded into the resource system.

The variable can be set in the project's CMakeLists.txt as follows:

     set(QT_QML_NO_CACHEGEN TRUE)
     qt_add_qml_module(MyModule
         URI MyModule
         VERSION 1.0
         ...
     )