diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-10-30 11:27:36 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-11-12 18:06:36 +0100 |
commit | 8cdbcee614dbb34d4ac770bee1734c18ea27fa12 (patch) | |
tree | e992b2070de283c558df9e261580365d5ccf4937 /src/qml/CMakeLists.txt | |
parent | ccb9c17d29cb680dd01318f5e59e7edab26b73c6 (diff) |
CMake: Allow building pure QML modules not backed by C++ sources
When no C++ sources are passed to qt_internal_add_qml_plugin (a pure
QML module), create a C++ backed Qt plugin anyway.
In such a case, generate a dummy plugin.cpp containing a
QQmlEngineExtensionPlugin subclass.
The class name is autogenerated from the QML import URI.
The class constructor will call the qmltyperegistrar generated
void qml_register_types_foo() function, to ensure the needed module
versions are registered for the QML module.
Change-Id: I19959dafdf0dc837c6037e7dc1d549b7420110a7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/CMakeLists.txt')
-rw-r--r-- | src/qml/CMakeLists.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/qml/CMakeLists.txt b/src/qml/CMakeLists.txt index 68e5a94734..596a8fdfc0 100644 --- a/src/qml/CMakeLists.txt +++ b/src/qml/CMakeLists.txt @@ -668,4 +668,10 @@ qt_copy_or_install(FILES "${CMAKE_CURRENT_LIST_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}ImportScannerTemplate.cpp.in" DESTINATION "${config_install_dir}" ) + +# Install pure QML Plugin template cpp file. +qt_copy_or_install(FILES + "${CMAKE_CURRENT_LIST_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}PluginTemplate.cpp.in" + DESTINATION "${config_install_dir}" +) # special case end |