aboutsummaryrefslogtreecommitdiffstats
path: root/src/webchannel/CMakeLists.txt
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2023-02-02 08:43:05 +0100
committerMichal Klocek <michal.klocek@qt.io>2023-02-03 13:37:42 +0100
commit48d2066d6c9b38f29368e5205a5b7f49ab3fa857 (patch)
treec40f1f840b7450248e1a0549c0caa75b6d536dd9 /src/webchannel/CMakeLists.txt
parent165ecd37b44e6c96c0e85afc5ea4a1bc392e035e (diff)
Fix project structure and auto registry
Create QtWebChannelQuick and move the required sources, so auto registry works and qml types files and friends are auto generated. This makes things inline what other modules do. This change has a side effect as qqmlwebchannel.h will change its module, however this is semi-pulibc header, hopefully only used by QtWebEngine. [ChangeLog] Created new QtWebChannelQuick which holds qml sources. Task-number: QTBUG-110795 Fixes: QTBUG-99959 Change-Id: Ic8aa72f070d6a9e23d918a1210f4df62df739397 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/webchannel/CMakeLists.txt')
-rw-r--r--src/webchannel/CMakeLists.txt48
1 files changed, 10 insertions, 38 deletions
diff --git a/src/webchannel/CMakeLists.txt b/src/webchannel/CMakeLists.txt
index 9354973..fd5c08b 100644
--- a/src/webchannel/CMakeLists.txt
+++ b/src/webchannel/CMakeLists.txt
@@ -1,13 +1,8 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
-# Generated from webchannel.pro.
-
-#####################################################################
-## WebChannel Module:
-#####################################################################
-
qt_internal_add_module(WebChannel
+ GENERATE_CPP_EXPORTS
SOURCES
qmetaobjectpublisher.cpp qmetaobjectpublisher_p.h
qwebchannel.cpp qwebchannel.h qwebchannel_p.h
@@ -16,49 +11,26 @@ qt_internal_add_module(WebChannel
qwebchannelglobal.h
LIBRARIES
Qt::CorePrivate
- PUBLIC_LIBRARIES
- Qt::Core
- PRIVATE_MODULE_INTERFACE
- Qt::CorePrivate
- GENERATE_CPP_EXPORTS
)
-# Resources:
-set_source_files_properties("../../examples/webchannel/shared/qwebchannel.js"
- PROPERTIES QT_RESOURCE_ALIAS "qwebchannel.js"
-)
-set(resources_resource_files
- "../../examples/webchannel/shared/qwebchannel.js"
+set(resource_file "../../examples/webchannel/shared/qwebchannel.js")
+set_source_files_properties(${resource_file} PROPERTIES
+ QT_RESOURCE_ALIAS "qwebchannel.js"
)
-set_source_files_properties(${resources_resource_files} PROPERTIES QT_SKIP_QUICKCOMPILER 1)
-
qt_internal_add_resource(WebChannel "resources"
PREFIX
"/qtwebchannel/"
FILES
- ${resources_resource_files}
+ ${resource_file}
)
+if(TARGET Qt::Qml)
+ qt_internal_extend_target(WebChannel PUBLIC_LIBRARIES Qt::Qml)
+else()
+ qt_internal_extend_target(WebChannel DEFINES QT_NO_JSVALUE)
+endif()
-#### Keys ignored in scope 1:.:.:webchannel.pro:<TRUE>:
-# OTHER_FILES = "qwebchannel.js"
-
-## Scopes:
-#####################################################################
-
-qt_internal_extend_target(WebChannel CONDITION TARGET Qt::Qml
- SOURCES
- qqmlwebchannel.cpp qqmlwebchannel.h
- qqmlwebchannelattached.cpp qqmlwebchannelattached_p.h
- PUBLIC_LIBRARIES
- Qt::Qml
-)
-
-qt_internal_extend_target(WebChannel CONDITION NOT TARGET Qt::Qml
- DEFINES
- QT_NO_JSVALUE
-)
qt_internal_add_docs(WebChannel
doc/qtwebchannel.qdocconf
)