[Development] How to make a qt6 module using cmake?

Bogdan Vatra bogdan.vatra at kdab.com
Tue Nov 21 13:21:15 CET 2023


Hello there,

  I'm trying to port a qt5 module to qt6 which it seems starting with 6.4.x 
the qmake support is broke/removed for modules so I'm forced to use cmake...

I checked other qt modules (e.g. https://code.qt.io/cgit/qt/qtmqtt.git/tree) 
and I did mostly the same but there are a few problems:

 - They all use *internal* (version specific) stuff (e.g. 
qt_internal_project_setup, qt_internal_add_qml_module, etc.).
 - the `install` target doesn't install examples srcs.
 - how to add docs to examples? With qmake I needed only to have a `doc` 
folder in the example folder and it will parse all the .qdoc files for me.
 - the `docs` target doesn't seem to work:
```
qt.qdoc: Cannot find index directory:  "/home/bogdan/work/qt/qtmqtt/b/./doc"
/home/bogdan/work/qt/qtmqtt/src/mqtt/doc/qtmqtt.qdocconf:1: (qdoc) error: 
Cannot open file '//./doc/global/qt-module-defaults.qdocconf': No such file or 
directory
Cannot open file '//./doc/global/qt-module-defaults.qdocconf': No such file or 
directory
```

So, what's the recommended way to make a qt6 module using cmake?

Cheers,
BogDan.




More information about the Development mailing list