- 
    Task 
- 
    Resolution: Done
- 
    P2: Important 
- 
    None
Currently qtbase and qtdeclarative have some public CMake API marked as Technical Preview.
The important bits are the qt_add_plugin and qt6_add_qml_module ones.
They should be refactored / fixed, to ensure they work for public example projects (importantly as standalone projects).
This probably implies moving a big chunk of qt_internal_add_plugin implementation into the public qt_add_plugin counterpart.
The main idea behind the refactoring would be not to have duplicate target creation in the public and private counterparts.
So for qt_internal_add_plugin and qt6_add_plugin case, the add_library() calls should be removed from the internal function, and moved into the public one, as well as any additional logic that makes sense to move (like CLASS_NAME handling, plugin type handling, qml plugin handling, file name suffix handling, etc).
The OUTPUT_DIR and INSTALL_DIR logic should probably be kept in the internal variant.
The same should be done for qt_internal_add_qml_module and qt6_add_qml_module.
- is required for
- 
                    QTBUG-89274 Make public, documented API for compile time QML type registration with CMake -         
- Closed
 
-         
- 
                     QTBUG-94581
        Review and Document new Qt 6.2 CMake API QTBUG-94581
        Review and Document new Qt 6.2 CMake API-         
- Closed
 
-         
- relates to
- 
                     QTBUG-86827
        Document new Qt 6 CMake API QTBUG-86827
        Document new Qt 6 CMake API-         
- Closed
 
-         
- 
                    QTBUG-91522 qt_internal_add_qml_module() calls through to qt6_add_plugin() but qt6_add_qml_module() doesn't -         
- Reported
 
-         
- 
                    QTBUG-82598 Establish a public API for building static QML plugins -         
- Closed
 
-         
- 
                    QTBUG-91621 Add a CMake wrapper for building a QML-friendly library -         
- Closed
 
-         
- mentioned in
- 
                    Page Loading... 
| For Gerrit Dashboard: QTBUG-88763 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V | 
| 336105,8 | CMake: Fix argument handling in qt_internal_add_qml_module() and friends | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 | 
| 338306,3 | CMake: Fix argument handling in qt_internal_add_qml_module() and friends | 6.1 | qt/qtdeclarative | Status: MERGED | +2 | 0 | 
| 339222,5 | Refactor qt_internal_add_plugin() and qt6_add_plugin() | dev | qt/qtbase | Status: MERGED | +2 | 0 | 
| 339240,4 | CMake: Account for qtbase refactoring in qt_internal_add_plugin() | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 | 
| 339241,6 | Use CLASS_NAME rather than CLASSNAME for qt6_add_qml_module() | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 | 
| 341052,2 | Refactor qt_internal_add_plugin() and qt6_add_plugin() | 6.1 | qt/qtbase | Status: MERGED | +2 | 0 | 
| 341400,2 | CMake: Account for qtbase refactoring in qt_internal_add_plugin() | 6.1 | qt/qtdeclarative | Status: MERGED | +2 | 0 | 
| 342021,3 | CMake: Choose better defaults for qt_add_plugin STATIC/SHARED | dev | qt/qtbase | Status: MERGED | +2 | 0 | 
| 342184,2 | CMake: Choose better defaults for qt_add_plugin STATIC/SHARED | 6.1 | qt/qtbase | Status: MERGED | +2 | 0 | 
| 346273,36 | Refactor and update qml CMake API | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 | 
| 349635,2 | CMake: Provide supported qt_internal_add_module() args via a function | dev | qt/qtbase | Status: MERGED | +2 | 0 | 
| 349642,15 | WIP: CMake: Move builtins and tooling under src/qmlcompiler | dev | qt/qtdeclarative | Status: DEFERRED | -2 | 0 | 
| 354443,9 | Add initial qml CMake API docs | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 | 
| 355213,6 | WIP: CMake public API review | dev | qt/qtbase | Status: ABANDONED | -2 | 0 | 
| 355215,2 | CMake: Remove old add_qt_gui_executable API | dev | qt/qtbase | Status: MERGED | +2 | 0 | 
| 355216,3 | CMake: Rename qt6_finalize_ios_app to be internal | dev | qt/qtbase | Status: MERGED | +2 | 0 | 
| 355218,2 | WIP: CMake public API review | dev | qt/qtdeclarative | Status: ABANDONED | -2 | 0 | 
| 355221,2 | WIP: CMake public API review | dev | qt/qttools | Status: ABANDONED | -2 | 0 | 
| 355223,2 | WIP: CMake public API review | dev | qt/qtactiveqt | Status: ABANDONED | -2 | 0 | 
| 355226,2 | WIP: CMake public API review | dev | qt/qtquick3d | Status: ABANDONED | -2 | 0 | 
| 355228,1 | WIP: CMake public API review | dev | qt/qtscxml | Status: ABANDONED | -2 | 0 | 
| 355229,1 | WIP: CMake public API review | dev | qt/qtwayland | Status: ABANDONED | -2 | 0 | 
| 355230,1 | WIP: CMake public API review | dev | qt/qtremoteobjects | Status: ABANDONED | -2 | 0 | 
| 355231,1 | WIP: CMake public API review | dev | qt/qtshadertools | Status: ABANDONED | -2 | 0 | 
| 355294,2 | CMake: Remove old add_qt_gui_executable API | 6.2 | qt/qtbase | Status: MERGED | +2 | 0 | 
| 355295,2 | CMake: Rename qt6_finalize_ios_app to be internal | 6.2 | qt/qtbase | Status: MERGED | +2 | 0 | 
| 357982,2 | Add missing version less variant of qt6_target_typelibs | 6.2 | qt/qtactiveqt | Status: MERGED | +2 | 0 | 
| 357983,2 | Add missing version less variant of qt6_target_typelibs | 6.1 | qt/qtactiveqt | Status: MERGED | +2 | 0 | 
| 358035,4 | Add missing version less variant of qt6_target_typelibs | dev | qt/qtactiveqt | Status: MERGED | +2 | 0 | 
| 361522,2 | Add initial qml CMake API docs | 6.2 | qt/qtdeclarative | Status: MERGED | +2 | 0 |