diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-10-27 12:32:20 +0100 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-11-06 13:00:54 +0100 |
commit | cd513c3e1767c7ca3626d4150609fd704c02e4f1 (patch) | |
tree | 2431c89352a499537dee6a304899b78527be284c /src/qml/Qt6QmlBuildInternals.cmake | |
parent | 4a9e5c5e89e403b492f08c5a4a1f5334a8b21ad3 (diff) |
CMake: Clean up logic to prepare building pure QML modules
Make sure we don't create bogus typeinfo entries, do create a target if
there are no C++ files, and do install created targets.
This way we do build the qmlcachegen-created files and link them into a
library which is subsequently deployed. It's not a real plugin, though,
and we need to specially handle this in QML. That's material for a
separate change.
Change-Id: I516d4611b6041a23489ce57df38dd83114dcc5de
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/qml/Qt6QmlBuildInternals.cmake')
-rw-r--r-- | src/qml/Qt6QmlBuildInternals.cmake | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/qml/Qt6QmlBuildInternals.cmake b/src/qml/Qt6QmlBuildInternals.cmake index c2018d71f8..a9b20235ad 100644 --- a/src/qml/Qt6QmlBuildInternals.cmake +++ b/src/qml/Qt6QmlBuildInternals.cmake @@ -91,7 +91,7 @@ function(qt_internal_add_qml_module target) endif() - if (arg_CPP_PLUGIN) + if (arg_CPP_PLUGIN OR arg_SOURCES) set(no_create_option DO_NOT_CREATE_TARGET) endif() @@ -121,6 +121,16 @@ function(qt_internal_add_qml_module target) qt_path_join(qml_module_install_dir ${QT_INSTALL_DIR} "${INSTALL_QMLDIR}/${arg_TARGET_PATH}") + set(qml_module_build_dir "") + if(NOT QT_WILL_INSTALL) + qt_path_join(qml_module_build_dir ${QT_INSTALL_DIR} "${INSTALL_QMLDIR}/${arg_TARGET_PATH}") + set(qml_module_build_dir OUTPUT_DIRECTORY "${qml_module_build_dir}") + endif() + + if (arg_SOURCES AND NOT arg_TYPEINFO) + set(arg_TYPEINFO "plugins.qmltypes") + endif() + qt6_add_qml_module(${target} ${designer_supported_arg} ${no_create_option} @@ -138,8 +148,8 @@ function(qt_internal_add_qml_module target) OPTIONAL_IMPORTS "${arg_OPTIONAL_IMPORTS}" TYPEINFO "${arg_TYPEINFO}" DO_NOT_INSTALL_METADATA - DO_NOT_CREATE_TARGET INSTALL_QML_FILES + ${qml_module_build_dir} INSTALL_LOCATION "${qml_module_install_dir}" DEPENDENCIES ${arg_DEPENDENCIES} RESOURCE_EXPORT "${INSTALL_CMAKE_NAMESPACE}${target}Targets" |