diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-05-28 11:04:05 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-06-05 10:27:12 +0200 |
commit | bc9164377820121cf4ddaa743acd2e349f7dd044 (patch) | |
tree | ab2003db747c92600026195a4108ce110350df62 | |
parent | e9f4133c9ec52509b55230c336f5d3e7afe35399 (diff) |
CMake: Update to latest qml CMake API
Task-number: QTBUG-91621
Change-Id: Iac28e71b7e581aa7199d4d3b3890b6d5f9d6c8eb
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r-- | src/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/imports/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/imports/scxmlstatemachine/CMakeLists.txt | 25 | ||||
-rw-r--r-- | src/imports/scxmlstatemachine/plugin.cpp | 63 | ||||
-rw-r--r-- | src/imports/statemachine/CMakeLists.txt | 24 | ||||
-rw-r--r-- | src/imports/statemachine/plugin.cpp | 61 | ||||
-rw-r--r-- | src/scxml/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/scxmlqml/CMakeLists.txt | 16 | ||||
-rw-r--r-- | src/statemachineqml/CMakeLists.txt | 16 |
9 files changed, 10 insertions, 202 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b6aadb2..f1b7c2b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,6 +4,5 @@ add_subdirectory(statemachine) if(TARGET Qt::Qml) add_subdirectory(statemachineqml) add_subdirectory(scxmlqml) - add_subdirectory(imports) endif() add_subdirectory(plugins) diff --git a/src/imports/CMakeLists.txt b/src/imports/CMakeLists.txt deleted file mode 100644 index 8c46ff5..0000000 --- a/src/imports/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ - -add_subdirectory(scxmlstatemachine) -add_subdirectory(statemachine) diff --git a/src/imports/scxmlstatemachine/CMakeLists.txt b/src/imports/scxmlstatemachine/CMakeLists.txt deleted file mode 100644 index 89981f5..0000000 --- a/src/imports/scxmlstatemachine/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ - - -##################################################################### -## scxml Plugin: -##################################################################### - -qt_internal_add_qml_module(declarative_scxml - URI "QtScxml" - VERSION "${PROJECT_VERSION}" - CLASSNAME QScxmlStateMachinePlugin - SKIP_TYPE_REGISTRATION - PLUGIN_OPTIONAL - SOURCES - plugin.cpp - PUBLIC_LIBRARIES - Qt::Core - Qt::Qml - LIBRARIES - Qt::ScxmlQmlPrivate -) - -#### Keys ignored in scope 1:.:.:scxmlstatemachine.pro:<TRUE>: -# IMPORT_VERSION = "5.$$QT_MINOR_VERSION" -# OTHER_FILES = "plugins.qmltypes" "qmldir" -# TARGETPATH = "QtScxml" diff --git a/src/imports/scxmlstatemachine/plugin.cpp b/src/imports/scxmlstatemachine/plugin.cpp deleted file mode 100644 index 9812406..0000000 --- a/src/imports/scxmlstatemachine/plugin.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtScxml module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtScxmlQml/private/qscxmlqmlglobals_p.h> -#include <QtQml/qqmlextensionplugin.h> -#include <QtQml/qqml.h> - -QT_BEGIN_NAMESPACE - -class QScxmlStateMachinePlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) - -public: - QScxmlStateMachinePlugin(QObject *parent = nullptr) : QQmlExtensionPlugin(parent) { } - void registerTypes(const char *) override - { - // Build-time generated registration function - volatile auto registration = &qml_register_types_QtScxml; - Q_UNUSED(registration); - } -}; - -QT_END_NAMESPACE - -#include "plugin.moc" diff --git a/src/imports/statemachine/CMakeLists.txt b/src/imports/statemachine/CMakeLists.txt deleted file mode 100644 index a36639a..0000000 --- a/src/imports/statemachine/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ - -##################################################################### -## qtqmlstatemachine Plugin: -##################################################################### - -qt_internal_add_qml_module(qtqmlstatemachine - URI "QtQml.StateMachine" - VERSION "${PROJECT_VERSION}" - CLASSNAME QtQmlStateMachinePlugin - SKIP_TYPE_REGISTRATION - PLUGIN_OPTIONAL - SOURCES - plugin.cpp - PUBLIC_LIBRARIES - Qt::Core - Qt::Qml - LIBRARIES - Qt::StateMachineQmlPrivate -) - -#### Keys ignored in scope 1:.:.:statemachine.pro:<TRUE>: -# CXX_MODULE = "qml" -# QML_IMPORT_VERSION = "$$QT_VERSION" -# TARGETPATH = "QtQml/StateMachine" diff --git a/src/imports/statemachine/plugin.cpp b/src/imports/statemachine/plugin.cpp deleted file mode 100644 index 1c2e211..0000000 --- a/src/imports/statemachine/plugin.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Ford Motor Company -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtStateMachineQml/private/qstatemachineqmlglobals_p.h> -#include <QtQml/qqmlextensionplugin.h> -#include <QtQml/qqml.h> - -QT_BEGIN_NAMESPACE - -class QtQmlStateMachinePlugin : public QQmlEngineExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID QQmlEngineExtensionInterface_iid) - -public: - QtQmlStateMachinePlugin(QObject *parent = nullptr) : QQmlEngineExtensionPlugin(parent) - { - volatile auto registration = &qml_register_types_QtQml_StateMachine; - Q_UNUSED(registration); - } -}; - -QT_END_NAMESPACE - -#include "plugin.moc" diff --git a/src/scxml/CMakeLists.txt b/src/scxml/CMakeLists.txt index 5857d2e..53050d3 100644 --- a/src/scxml/CMakeLists.txt +++ b/src/scxml/CMakeLists.txt @@ -31,9 +31,6 @@ qt_internal_add_module(Scxml Qt::CorePrivate ) -# This allows QML element registration outside of this module with the "QML_ELEMENT" & friends -qt6_extract_metatypes(Scxml) - # Install the public qscxlmc.prf file that is used by the qmake set(scxml_mkspecs "${CMAKE_CURRENT_SOURCE_DIR}/../../mkspecs/features/qscxmlc.prf") set(mkspecs_install_dir "${INSTALL_MKSPECSDIR}") diff --git a/src/scxmlqml/CMakeLists.txt b/src/scxmlqml/CMakeLists.txt index 120aae9..64762ca 100644 --- a/src/scxmlqml/CMakeLists.txt +++ b/src/scxmlqml/CMakeLists.txt @@ -1,4 +1,8 @@ -qt_internal_add_module(ScxmlQml +qt_internal_add_qml_module(ScxmlQml + URI "QtScxml" + VERSION "${PROJECT_VERSION}" + PLUGIN_TARGET declarative_scxml + CLASS_NAME QScxmlStateMachinePlugin SOURCES eventconnection.cpp eventconnection_p.h invokedservices.cpp invokedservices_p.h @@ -14,13 +18,3 @@ qt_internal_add_module(ScxmlQml LIBRARIES Qt::CorePrivate ) - -set_target_properties(ScxmlQml PROPERTIES - QT_QML_MODULE_INSTALL_QMLTYPES TRUE - QT_QML_MODULE_VERSION ${PROJECT_VERSION} - QT_QML_MODULE_URI QtScxml - QT_QMLTYPES_FILENAME plugins.qmltypes - QT_QML_MODULE_INSTALL_DIR "${INSTALL_QMLDIR}/QtScxml" -) - -qt6_qml_type_registration(ScxmlQml) diff --git a/src/statemachineqml/CMakeLists.txt b/src/statemachineqml/CMakeLists.txt index a30d76a..f25471a 100644 --- a/src/statemachineqml/CMakeLists.txt +++ b/src/statemachineqml/CMakeLists.txt @@ -1,4 +1,8 @@ -qt_internal_add_module(StateMachineQml +qt_internal_add_qml_module(StateMachineQml + URI "QtQml.StateMachine" + VERSION "${PROJECT_VERSION}" + PLUGIN_TARGET qtqmlstatemachine + CLASS_NAME QtQmlStateMachinePlugin SOURCES qstatemachineqmlglobals_p.h finalstate_p.h finalstate.cpp @@ -17,13 +21,3 @@ qt_internal_add_module(StateMachineQml LIBRARIES Qt::QmlPrivate ) - -set_target_properties(StateMachineQml PROPERTIES - QT_QML_MODULE_INSTALL_QMLTYPES TRUE - QT_QML_MODULE_VERSION ${PROJECT_VERSION} - QT_QML_MODULE_URI QtQml.StateMachine - QT_QMLTYPES_FILENAME plugins.qmltypes - QT_QML_MODULE_INSTALL_DIR "${INSTALL_QMLDIR}/QtQml/StateMachine" -) - -qt6_qml_type_registration(StateMachineQml) |