From 542e6dce99e6fd12c021a99989288e77b15ab9ac Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 3 Jun 2021 16:13:23 +0200 Subject: Update to latest CMake API for QML Task-number: QTBUG-91621 Change-Id: I5c242223fc58a6980fcb3a909997ed7f966624b1 Reviewed-by: Ulf Hermann Reviewed-by: Andrei Golubev --- src/CMakeLists.txt | 1 - src/quick3d/imports/animation/CMakeLists.txt | 8 +++++-- src/quick3d/imports/core/CMakeLists.txt | 32 ------------------------- src/quick3d/imports/extras/CMakeLists.txt | 8 +++++-- src/quick3d/imports/input/CMakeLists.txt | 8 +++++-- src/quick3d/imports/logic/CMakeLists.txt | 8 +++++-- src/quick3d/imports/render/CMakeLists.txt | 8 +++++-- src/quick3d/imports/scene2d/CMakeLists.txt | 8 +++++-- src/quick3d/imports/scene3d/CMakeLists.txt | 8 +++++-- src/quick3d/quick3d/CMakeLists.txt | 35 +++++++++++++++++++++------- 10 files changed, 68 insertions(+), 56 deletions(-) delete mode 100644 src/quick3d/imports/core/CMakeLists.txt (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index dde6b2911..cf11873e3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -36,7 +36,6 @@ if(TARGET Qt::Quick) # Quick3D imports if (TARGET Qt::3DRender) - add_subdirectory(quick3d/imports/core) add_subdirectory(quick3d/imports/render) add_subdirectory(quick3d/imports/scene3d) if (TARGET Qt::3DExtras) diff --git a/src/quick3d/imports/animation/CMakeLists.txt b/src/quick3d/imports/animation/CMakeLists.txt index 621356d97..407fc9708 100644 --- a/src/quick3d/imports/animation/CMakeLists.txt +++ b/src/quick3d/imports/animation/CMakeLists.txt @@ -7,8 +7,12 @@ qt_internal_add_qml_module(quick3danimationplugin URI "Qt3D.Animation" VERSION "2.${PROJECT_VERSION_MINOR}" - CLASSNAME Qt3DQuick3DAnimationPlugin - SKIP_TYPE_REGISTRATION + CLASS_NAME Qt3DQuick3DAnimationPlugin + PLUGIN_TARGET quick3danimationplugin + NO_PLUGIN_OPTIONAL + NO_GENERATE_PLUGIN_SOURCE + NO_GENERATE_QMLTYPES + INSTALL_SOURCE_QMLTYPES "plugins.qmltypes" SOURCES qt3dquick3danimationplugin.cpp qt3dquick3danimationplugin.h PUBLIC_LIBRARIES diff --git a/src/quick3d/imports/core/CMakeLists.txt b/src/quick3d/imports/core/CMakeLists.txt deleted file mode 100644 index a8229bd0f..000000000 --- a/src/quick3d/imports/core/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -# Generated from importscore.pro. - -##################################################################### -## quick3dcoreplugin Plugin: -##################################################################### - -qt_internal_add_qml_module(quick3dcoreplugin - URI "Qt3D.Core" - VERSION "2.${PROJECT_VERSION_MINOR}" - CLASSNAME Qt3DQuick3DCorePlugin - SKIP_TYPE_REGISTRATION - SOURCES - qt3dquick3dcoreplugin.cpp qt3dquick3dcoreplugin.h - PUBLIC_LIBRARIES - Qt::3DCore - Qt::3DCorePrivate - Qt::3DQuick - Qt::3DQuickPrivate - Qt::Core - Qt::CorePrivate - Qt::Gui - Qt::Qml - Qt::QmlPrivate - Qt::Quick - Qt::QuickPrivate -) - -#### Keys ignored in scope 1:.:.:importscore.pro:: -# CXX_MODULE = "qml" -# IMPORT_VERSION = "2.$$QT_MINOR_VERSION" -# OTHER_FILES = "qmldir" -# TARGETPATH = "Qt3D/Core" diff --git a/src/quick3d/imports/extras/CMakeLists.txt b/src/quick3d/imports/extras/CMakeLists.txt index b3d2636f0..886718038 100644 --- a/src/quick3d/imports/extras/CMakeLists.txt +++ b/src/quick3d/imports/extras/CMakeLists.txt @@ -7,10 +7,14 @@ qt_internal_add_qml_module(quick3dextrasplugin URI "Qt3D.Extras" VERSION "2.${PROJECT_VERSION_MINOR}" - CLASSNAME Qt3DQuick3DExtrasPlugin + CLASS_NAME Qt3DQuick3DExtrasPlugin + PLUGIN_TARGET quick3dextrasplugin + NO_PLUGIN_OPTIONAL + NO_GENERATE_PLUGIN_SOURCE + NO_GENERATE_QMLTYPES + INSTALL_SOURCE_QMLTYPES "plugins.qmltypes" DEPENDENCIES Qt3D.Logic/2.0 - SKIP_TYPE_REGISTRATION SOURCES qt3dquick3dextrasplugin.cpp qt3dquick3dextrasplugin.h PUBLIC_LIBRARIES diff --git a/src/quick3d/imports/input/CMakeLists.txt b/src/quick3d/imports/input/CMakeLists.txt index 6201a0b74..c02f2a68c 100644 --- a/src/quick3d/imports/input/CMakeLists.txt +++ b/src/quick3d/imports/input/CMakeLists.txt @@ -7,8 +7,12 @@ qt_internal_add_qml_module(quick3dinputplugin URI "Qt3D.Input" VERSION "2.${PROJECT_VERSION_MINOR}" - CLASSNAME Qt3DQuick3DInputPlugin - SKIP_TYPE_REGISTRATION + CLASS_NAME Qt3DQuick3DInputPlugin + PLUGIN_TARGET quick3dinputplugin + NO_PLUGIN_OPTIONAL + NO_GENERATE_PLUGIN_SOURCE + NO_GENERATE_QMLTYPES + INSTALL_SOURCE_QMLTYPES "plugins.qmltypes" SOURCES qt3dquick3dinputplugin.cpp qt3dquick3dinputplugin.h PUBLIC_LIBRARIES diff --git a/src/quick3d/imports/logic/CMakeLists.txt b/src/quick3d/imports/logic/CMakeLists.txt index 2d7b5ea9b..d6267cd2b 100644 --- a/src/quick3d/imports/logic/CMakeLists.txt +++ b/src/quick3d/imports/logic/CMakeLists.txt @@ -7,8 +7,12 @@ qt_internal_add_qml_module(quick3dlogicplugin URI "Qt3D.Logic" VERSION "2.${PROJECT_VERSION_MINOR}" - CLASSNAME Qt3DQuick3DLogicPlugin - SKIP_TYPE_REGISTRATION + CLASS_NAME Qt3DQuick3DLogicPlugin + PLUGIN_TARGET quick3dlogicplugin + NO_PLUGIN_OPTIONAL + NO_GENERATE_PLUGIN_SOURCE + NO_GENERATE_QMLTYPES + INSTALL_SOURCE_QMLTYPES "plugins.qmltypes" SOURCES qt3dquick3dlogicplugin.cpp qt3dquick3dlogicplugin.h PUBLIC_LIBRARIES diff --git a/src/quick3d/imports/render/CMakeLists.txt b/src/quick3d/imports/render/CMakeLists.txt index c0f352c89..23df017da 100644 --- a/src/quick3d/imports/render/CMakeLists.txt +++ b/src/quick3d/imports/render/CMakeLists.txt @@ -7,8 +7,12 @@ qt_internal_add_qml_module(quick3drenderplugin URI "Qt3D.Render" VERSION "2.${PROJECT_VERSION_MINOR}" - CLASSNAME Qt3DQuick3DRenderPlugin - SKIP_TYPE_REGISTRATION + CLASS_NAME Qt3DQuick3DRenderPlugin + PLUGIN_TARGET quick3drenderplugin + NO_PLUGIN_OPTIONAL + NO_GENERATE_PLUGIN_SOURCE + NO_GENERATE_QMLTYPES + INSTALL_SOURCE_QMLTYPES "plugins.qmltypes" SOURCES qt3dquick3drenderplugin.cpp qt3dquick3drenderplugin.h PUBLIC_LIBRARIES diff --git a/src/quick3d/imports/scene2d/CMakeLists.txt b/src/quick3d/imports/scene2d/CMakeLists.txt index aeb119f6c..c2a3764fc 100644 --- a/src/quick3d/imports/scene2d/CMakeLists.txt +++ b/src/quick3d/imports/scene2d/CMakeLists.txt @@ -7,8 +7,12 @@ qt_internal_add_qml_module(qtquickscene2dplugin URI "QtQuick.Scene2D" VERSION "2.${PROJECT_VERSION_MINOR}" - CLASSNAME QtQuickScene2DPlugin - SKIP_TYPE_REGISTRATION + CLASS_NAME QtQuickScene2DPlugin + PLUGIN_TARGET qtquickscene2dplugin + NO_PLUGIN_OPTIONAL + NO_GENERATE_PLUGIN_SOURCE + NO_GENERATE_QMLTYPES + INSTALL_SOURCE_QMLTYPES "plugins.qmltypes" SOURCES qtquickscene2dplugin.cpp qtquickscene2dplugin.h PUBLIC_LIBRARIES diff --git a/src/quick3d/imports/scene3d/CMakeLists.txt b/src/quick3d/imports/scene3d/CMakeLists.txt index 722f33bed..6e0be2764 100644 --- a/src/quick3d/imports/scene3d/CMakeLists.txt +++ b/src/quick3d/imports/scene3d/CMakeLists.txt @@ -7,8 +7,12 @@ qt_internal_add_qml_module(qtquickscene3dplugin URI "QtQuick.Scene3D" VERSION "2.${PROJECT_VERSION_MINOR}" - CLASSNAME QtQuickScene3DPlugin - SKIP_TYPE_REGISTRATION + CLASS_NAME QtQuickScene3DPlugin + PLUGIN_TARGET qtquickscene3dplugin + NO_PLUGIN_OPTIONAL + NO_GENERATE_PLUGIN_SOURCE + NO_GENERATE_QMLTYPES + INSTALL_SOURCE_QMLTYPES "plugins.qmltypes" SOURCES qtquickscene3dplugin.cpp qtquickscene3dplugin.h scene3ditem.cpp scene3ditem_p.h diff --git a/src/quick3d/quick3d/CMakeLists.txt b/src/quick3d/quick3d/CMakeLists.txt index fedd41c8f..99aba2615 100644 --- a/src/quick3d/quick3d/CMakeLists.txt +++ b/src/quick3d/quick3d/CMakeLists.txt @@ -4,7 +4,14 @@ ## Qt::3DQuick Module: ##################################################################### -qt_internal_add_module(3DQuick +qt_internal_add_qml_module(3DQuick + URI "Qt3D.Core" + VERSION "${PROJECT_VERSION}" + PAST_MAJOR_VERSIONS 2 + CLASS_NAME Qt3DQuick3DCorePlugin + PLUGIN_TARGET quick3dcoreplugin + NO_PLUGIN_OPTIONAL + NO_GENERATE_PLUGIN_SOURCE SOURCES items/quick3dbuffer.cpp items/quick3dbuffer_p.h items/quick3dentity.cpp items/quick3dentity_p.h @@ -56,12 +63,22 @@ qt_internal_extend_target(3DQuick CONDITION gcov "-ftest-coverage" ) -set_target_properties(3DQuick PROPERTIES - QT_QML_MODULE_VERSION ${PROJECT_VERSION} - QT_QML_MODULE_URI Qt3D.Core - QT_QML_MODULE_INSTALL_QMLTYPES TRUE - QT_QMLTYPES_FILENAME plugins.qmltypes - QT_QML_MODULE_INSTALL_DIR "${INSTALL_QMLDIR}/Qt3D/Core" +# We can't move these sources into here because the directory structure needs +# to be maintained to support Qt5 qmake builds. +qt_internal_extend_target(quick3dcoreplugin + SOURCES + ../imports/core/qt3dquick3dcoreplugin.cpp + ../imports/core/qt3dquick3dcoreplugin.h + LIBRARIES + Qt::3DCore + Qt::3DCorePrivate + Qt::3DQuick + Qt::3DQuickPrivate + Qt::Core + Qt::CorePrivate + Qt::Gui + Qt::Qml + Qt::QmlPrivate + Qt::Quick + Qt::QuickPrivate ) - -qt6_qml_type_registration(3DQuick) -- cgit v1.2.3