Skip to content

CMake: Install separate plugin for private module

ivan tkachenko requested to merge work/ratijas/qmldir-private into master

These private sources can not be merged into main plugin, because a type in qmldir can not be both "internal" and "singleton".

In fact, upstream Qt CMake function would warn you about that, but in our case it didn't because that Qt function checks for property QT_QML_SINGLETON_TYPE when sources are being added, not at finalization call. But here we were setting those properties only after target_qml_sources(), so Qt didn't complain. Meanwhile our own code (kind of copy-paste from Qt) generates qmldir at finalize_qml_module but does not check whether both PRIVATE and QT_QML_SINGLETON_TYPE are set for a file. So we silently generated wrong metadata without singletons.

Edited by ivan tkachenko

Merge request reports