diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-01-29 10:01:43 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-01-29 20:11:17 +0100 |
commit | f64a9054e3b049fff4eb258658a020b403196b53 (patch) | |
tree | f74617f0217ec3081484d68a617a682fb3561f5a | |
parent | ac9eeb58ad5bc82c5c5df9f4f37079fadaaa1e11 (diff) | |
parent | 100d0d2ea35834d06c864a12d6f6829692c2d990 (diff) | |
download | qtwebchannel-f64a9054e3b049fff4eb258658a020b403196b53.tar.gz |
Merge "Merge remote-tracking branch 'origin/wip/cmake' into dev"
-rw-r--r-- | .cmake.conf | 1 | ||||
-rw-r--r-- | .prev_CMakeLists.txt | 20 | ||||
-rw-r--r-- | .qmake.conf | 2 | ||||
-rw-r--r-- | CMakeLists.txt | 20 | ||||
-rw-r--r-- | coin/module_config.yaml | 11 | ||||
-rw-r--r-- | examples/CMakeLists.txt | 7 | ||||
-rw-r--r-- | examples/webchannel/CMakeLists.txt | 18 | ||||
-rw-r--r-- | examples/webchannel/chatserver-cpp/CMakeLists.txt | 34 | ||||
-rw-r--r-- | examples/webchannel/standalone/.prev_CMakeLists.txt | 44 | ||||
-rw-r--r-- | examples/webchannel/standalone/CMakeLists.txt | 45 | ||||
-rw-r--r-- | qtwebchannel.pro | 6 | ||||
-rw-r--r-- | src/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/imports/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/imports/webchannel/.prev_CMakeLists.txt | 24 | ||||
-rw-r--r-- | src/imports/webchannel/CMakeLists.txt | 24 | ||||
-rw-r--r-- | src/imports/webchannel/webchannel.pro | 1 | ||||
-rw-r--r-- | src/webchannel/CMakeLists.txt | 65 | ||||
-rw-r--r-- | src/webchannel/webchannel.pro | 3 | ||||
-rw-r--r-- | tests/.prev_CMakeLists.txt | 7 | ||||
-rw-r--r-- | tests/CMakeLists.txt | 7 | ||||
-rw-r--r-- | tests/auto/.prev_CMakeLists.txt | 7 | ||||
-rw-r--r-- | tests/auto/CMakeLists.txt | 10 | ||||
-rw-r--r-- | tests/auto/qml/CMakeLists.txt | 36 | ||||
-rw-r--r-- | tests/auto/webchannel/CMakeLists.txt | 27 |
24 files changed, 427 insertions, 1 deletions
diff --git a/.cmake.conf b/.cmake.conf new file mode 100644 index 0000000..213991f --- /dev/null +++ b/.cmake.conf @@ -0,0 +1 @@ +set(QT_REPO_MODULE_VERSION "6.1.0") diff --git a/.prev_CMakeLists.txt b/.prev_CMakeLists.txt new file mode 100644 index 0000000..7197c4c --- /dev/null +++ b/.prev_CMakeLists.txt @@ -0,0 +1,20 @@ +# Generated from qtwebchannel.pro. + +cmake_minimum_required(VERSION 3.16) + +include(.cmake.conf) +project(QtWebChannel + VERSION "${QT_REPO_MODULE_VERSION}" + DESCRIPTION "Qt WebChannel Libraries" + HOMEPAGE_URL "https://qt.io/" + LANGUAGES CXX C +) + +find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core SET_ME_TO_SOMETHING_USEFUL) +find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS SET_ME_TO_SOMETHING_USEFUL) + +if(INTEGRITY) + message(NOTICE "Skipping the build as the condition \"NOT INTEGRITY\" is not met.") + return() +endif() +qt_build_repo() diff --git a/.qmake.conf b/.qmake.conf index 05001fb..19bfd74 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -1,4 +1,4 @@ load(qt_build_config) CONFIG += warning_clean -MODULE_VERSION = 6.0.0 +MODULE_VERSION = 6.1.0 diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..1943964 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,20 @@ +# Generated from qtwebchannel.pro. + +cmake_minimum_required(VERSION 3.16) + +include(.cmake.conf) +project(QtWebChannel + VERSION "${QT_REPO_MODULE_VERSION}" + DESCRIPTION "Qt WebChannel Libraries" + HOMEPAGE_URL "https://qt.io/" + LANGUAGES CXX C +) + +find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core) # special case +find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS Quick Test QuickTest WebSockets) # special case + +if(INTEGRITY) + message(NOTICE "Skipping the build as the condition \"NOT INTEGRITY\" is not met.") + return() +endif() +qt_build_repo() diff --git a/coin/module_config.yaml b/coin/module_config.yaml new file mode 100644 index 0000000..b229803 --- /dev/null +++ b/coin/module_config.yaml @@ -0,0 +1,11 @@ +version: 2 +accept_configuration: + condition: property + property: features + not_contains_value: Disable + +instructions: + Build: + - !include "{{qt/qtbase}}/coin_module_build_template_v2.yaml" + Test: + - !include "{{qt/qtbase}}/coin_module_test_template_v2.yaml" diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 0000000..4138540 --- /dev/null +++ b/examples/CMakeLists.txt @@ -0,0 +1,7 @@ +# Generated from examples.pro. + +qt_examples_build_begin() + +add_subdirectory(webchannel) + +qt_examples_build_end() diff --git a/examples/webchannel/CMakeLists.txt b/examples/webchannel/CMakeLists.txt new file mode 100644 index 0000000..78c2fb6 --- /dev/null +++ b/examples/webchannel/CMakeLists.txt @@ -0,0 +1,18 @@ +# Generated from webchannel.pro. + +# special case begin +# These are all TEMPLATE = aux +#add_subdirectory(nodejs) +#add_subdirectory(qwclient) +#add_subdirectory(chatclient-html) +# special case end +if(TARGET Qt::WebSockets) + add_subdirectory(chatserver-cpp) + # special case begin + # This one is TEMPLATE = aux too + #add_subdirectory(chatclient-qml) + # special case end +endif() +if(TARGET Qt::WebSockets AND TARGET Qt::Widgets) + add_subdirectory(standalone) +endif() diff --git a/examples/webchannel/chatserver-cpp/CMakeLists.txt b/examples/webchannel/chatserver-cpp/CMakeLists.txt new file mode 100644 index 0000000..3a3a2c9 --- /dev/null +++ b/examples/webchannel/chatserver-cpp/CMakeLists.txt @@ -0,0 +1,34 @@ +# Generated from chatserver-cpp.pro. + +cmake_minimum_required(VERSION 3.14) +project(chatserver LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples/webchannel/chatserver-cpp") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS WebSockets) +find_package(Qt6 COMPONENTS WebChannel) + +add_executable(chatserver + ../shared/websocketclientwrapper.cpp ../shared/websocketclientwrapper.h + ../shared/websockettransport.cpp ../shared/websockettransport.h + chatserver.cpp chatserver.h + main.cpp +) +target_link_libraries(chatserver PUBLIC + Qt::Core + Qt::WebChannel + Qt::WebSockets +) + +install(TARGETS chatserver + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/webchannel/standalone/.prev_CMakeLists.txt b/examples/webchannel/standalone/.prev_CMakeLists.txt new file mode 100644 index 0000000..a170cb6 --- /dev/null +++ b/examples/webchannel/standalone/.prev_CMakeLists.txt @@ -0,0 +1,44 @@ +# Generated from standalone.pro. + +cmake_minimum_required(VERSION 3.14) +project(standalone LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples/webchannel/standalone") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS WebChannel) +find_package(Qt6 COMPONENTS Widgets) +find_package(Qt6 COMPONENTS WebSockets) + +add_qt_gui_executable(standalone + ../shared/websocketclientwrapper.cpp ../shared/websocketclientwrapper.h + ../shared/websockettransport.cpp ../shared/websockettransport.h + core.h + dialog.cpp dialog.h dialog.ui + main.cpp +) +target_compile_definitions(standalone PUBLIC + ${CMAKE_CURRENT_BINARY_DIR}"\\\"\"" + BUILD_DIR="\" +) + +target_link_libraries(standalone PUBLIC + Qt::Core + Qt::Gui + Qt::WebChannel + Qt::WebSockets + Qt::Widgets +) + +install(TARGETS standalone + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/webchannel/standalone/CMakeLists.txt b/examples/webchannel/standalone/CMakeLists.txt new file mode 100644 index 0000000..78977cd --- /dev/null +++ b/examples/webchannel/standalone/CMakeLists.txt @@ -0,0 +1,45 @@ +# Generated from standalone.pro. + +cmake_minimum_required(VERSION 3.14) +project(standalone LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples/webchannel/standalone") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS WebChannel) +find_package(Qt6 COMPONENTS Widgets) +find_package(Qt6 COMPONENTS WebSockets) + +add_qt_gui_executable(standalone + ../shared/websocketclientwrapper.cpp ../shared/websocketclientwrapper.h + ../shared/websockettransport.cpp ../shared/websockettransport.h + core.h + dialog.cpp dialog.h dialog.ui + main.cpp +) +# special case begin +# pro2cmake generates invalid cmake syntax here +target_compile_definitions(standalone PUBLIC + "BUILD_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\"" +) +# special case end +target_link_libraries(standalone PUBLIC + Qt::Core + Qt::Gui + Qt::WebChannel + Qt::WebSockets + Qt::Widgets +) + +install(TARGETS standalone + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/qtwebchannel.pro b/qtwebchannel.pro index 6eb9398..c272f7c 100644 --- a/qtwebchannel.pro +++ b/qtwebchannel.pro @@ -1,3 +1,9 @@ requires(!integrity) load(qt_parts) + +OTHER_FILES += \ + sync.profile \ + .qmake.conf \ + dependencies.yaml \ + coin/module_config.yaml diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..a80a886 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,6 @@ +# Generated from src.pro. + +add_subdirectory(webchannel) +if(TARGET Qt::Quick) + add_subdirectory(imports) +endif() diff --git a/src/imports/CMakeLists.txt b/src/imports/CMakeLists.txt new file mode 100644 index 0000000..6c0c9ae --- /dev/null +++ b/src/imports/CMakeLists.txt @@ -0,0 +1,3 @@ +# Generated from imports.pro. + +add_subdirectory(webchannel) diff --git a/src/imports/webchannel/.prev_CMakeLists.txt b/src/imports/webchannel/.prev_CMakeLists.txt new file mode 100644 index 0000000..d7d2440 --- /dev/null +++ b/src/imports/webchannel/.prev_CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from webchannel.pro. + +##################################################################### +## webchannel Plugin: +##################################################################### + +qt_internal_add_qml_module(webchannel + URI "QtWebChannel" + VERSION "1.${CMAKE_PROJECT_VERSION_MINOR}" + CLASSNAME QWebChannelPlugin + SKIP_TYPE_REGISTRATION + SOURCES + plugin.cpp + INCLUDE_DIRECTORIES + ../../webchannel + PUBLIC_LIBRARIES + Qt::Core + Qt::Quick + Qt::WebChannelPrivate +) + +#### Keys ignored in scope 1:.:.:webchannel.pro:<TRUE>: +# IMPORT_VERSION = "1.$$QT_MINOR_VERSION" +# TARGETPATH = "QtWebChannel" diff --git a/src/imports/webchannel/CMakeLists.txt b/src/imports/webchannel/CMakeLists.txt new file mode 100644 index 0000000..6a05986 --- /dev/null +++ b/src/imports/webchannel/CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from webchannel.pro. + +##################################################################### +## webchannel Plugin: +##################################################################### + +qt_internal_add_qml_module(webchannel + URI "QtWebChannel" + VERSION "1.0" #special case + CLASSNAME QWebChannelPlugin + SKIP_TYPE_REGISTRATION + SOURCES + plugin.cpp + INCLUDE_DIRECTORIES + ../../webchannel + PUBLIC_LIBRARIES + Qt::Core + Qt::Quick + Qt::WebChannelPrivate +) + +#### Keys ignored in scope 1:.:.:webchannel.pro:<TRUE>: +# IMPORT_VERSION = "1.$$QT_MINOR_VERSION" +# TARGETPATH = "QtWebChannel" diff --git a/src/imports/webchannel/webchannel.pro b/src/imports/webchannel/webchannel.pro index fd69605..2141cd8 100644 --- a/src/imports/webchannel/webchannel.pro +++ b/src/imports/webchannel/webchannel.pro @@ -4,6 +4,7 @@ INCLUDEPATH += ../../webchannel VPATH += ../../webchannel IMPORT_VERSION = 1.$$QT_MINOR_VERSION +TARGETPATH = QtWebChannel SOURCES += \ plugin.cpp diff --git a/src/webchannel/CMakeLists.txt b/src/webchannel/CMakeLists.txt new file mode 100644 index 0000000..9fba217 --- /dev/null +++ b/src/webchannel/CMakeLists.txt @@ -0,0 +1,65 @@ +# Generated from webchannel.pro. + +##################################################################### +## WebChannel Module: +##################################################################### + +qt_add_module(WebChannel + SOURCES + qmetaobjectpublisher.cpp qmetaobjectpublisher_p.h + qwebchannel.cpp qwebchannel.h qwebchannel_p.h + qwebchannelabstracttransport.cpp qwebchannelabstracttransport.h + signalhandler_p.h + variantargument_p.h + LIBRARIES + Qt::CorePrivate + PUBLIC_LIBRARIES + Qt::Core + PRIVATE_MODULE_INTERFACE + Qt::CorePrivate +) + +# 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_source_files_properties(${resources_resource_files} PROPERTIES QT_SKIP_QUICKCOMPILER 1) + +qt_add_resource(WebChannel "resources" + PREFIX + "/qtwebchannel/" + FILES + ${resources_resource_files} +) + + +#### Keys ignored in scope 1:.:.:webchannel.pro:<TRUE>: +# OTHER_FILES = "qwebchannel.js" + +## Scopes: +##################################################################### + +qt_extend_target(WebChannel CONDITION TARGET Qt::Qml + SOURCES + qqmlwebchannel.cpp + qqmlwebchannelattached.cpp + PUBLIC_LIBRARIES + Qt::Qml +) + +#### Keys ignored in scope 2:.:.:webchannel.pro:TARGET Qt::Qml: +# PRIVATE_HEADERS = "qqmlwebchannelattached_p.h" +# PUBLIC_HEADERS = "qqmlwebchannel.h" + +qt_extend_target(WebChannel CONDITION NOT TARGET Qt::Qml + DEFINES + QT_NO_JSVALUE +) +qt_add_docs(WebChannel + doc/qtwebchannel.qdocconf +) + diff --git a/src/webchannel/webchannel.pro b/src/webchannel/webchannel.pro index 9c555e7..00e75f5 100644 --- a/src/webchannel/webchannel.pro +++ b/src/webchannel/webchannel.pro @@ -7,6 +7,9 @@ QMAKE_DOCS = $$PWD/doc/qtwebchannel.qdocconf RESOURCES += \ resources.qrc +QTQUICK_COMPILER_SKIPPED_RESOURCES += \ + resources.qrc + OTHER_FILES = \ qwebchannel.js diff --git a/tests/.prev_CMakeLists.txt b/tests/.prev_CMakeLists.txt new file mode 100644 index 0000000..2214137 --- /dev/null +++ b/tests/.prev_CMakeLists.txt @@ -0,0 +1,7 @@ +# Generated from tests.pro. + +if(QT_BUILD_STANDALONE_TESTS) + # Add qt_find_package calls for extra dependencies that need to be found when building + # the standalone tests here. +endif() +qt_build_tests() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 0000000..2214137 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,7 @@ +# Generated from tests.pro. + +if(QT_BUILD_STANDALONE_TESTS) + # Add qt_find_package calls for extra dependencies that need to be found when building + # the standalone tests here. +endif() +qt_build_tests() diff --git a/tests/auto/.prev_CMakeLists.txt b/tests/auto/.prev_CMakeLists.txt new file mode 100644 index 0000000..1fcf495 --- /dev/null +++ b/tests/auto/.prev_CMakeLists.txt @@ -0,0 +1,7 @@ +# Generated from auto.pro. + +add_subdirectory(cmake) +add_subdirectory(webchannel) +if(TARGET Qt::Quick) + add_subdirectory(qml) +endif() diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt new file mode 100644 index 0000000..716f70c --- /dev/null +++ b/tests/auto/CMakeLists.txt @@ -0,0 +1,10 @@ +# Generated from auto.pro. + +# special case begin +# Qt5 cmake tests +#add_subdirectory(cmake) +# special case end +add_subdirectory(webchannel) +if(TARGET Qt::Quick) + add_subdirectory(qml) +endif() diff --git a/tests/auto/qml/CMakeLists.txt b/tests/auto/qml/CMakeLists.txt new file mode 100644 index 0000000..c292d77 --- /dev/null +++ b/tests/auto/qml/CMakeLists.txt @@ -0,0 +1,36 @@ +# Generated from qml.pro. + +##################################################################### +## qml Test: +##################################################################### + +# Collect test data +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + data/*) +list(APPEND test_data ${test_data_glob}) + +qt_internal_add_test(tst_qmlwebchannel + QMLTEST + QML_IMPORTPATH + "${CMAKE_CURRENT_BINARY_DIR}/../../../qml" + "${CMAKE_CURRENT_SOURCE_DIR}" + SOURCES + qml.cpp + testobject.cpp testobject.h + testtransport.cpp testtransport.h + testwebchannel.cpp testwebchannel.h + LIBRARIES + Qt::CorePrivate + Qt::WebChannelPrivate + PUBLIC_LIBRARIES + Qt::Gui + Qt::WebChannel + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qml.pro:<TRUE>: +# DISTFILES = "tst_webchannelseparation.qml" +# IMPORTPATH = "$$OUT_PWD/../../../qml" "$$PWD" +# OTHER_FILES = "Client.qml" "WebChannelTest.qml" "tst_webchannel.qml" "tst_metaobjectpublisher.qml" "tst_bench.qml" "tst_multiclient.qml" +# TEMPLATE = "app" diff --git a/tests/auto/webchannel/CMakeLists.txt b/tests/auto/webchannel/CMakeLists.txt new file mode 100644 index 0000000..1f7d734 --- /dev/null +++ b/tests/auto/webchannel/CMakeLists.txt @@ -0,0 +1,27 @@ +# Generated from webchannel.pro. + +##################################################################### +## tst_webchannel Test: +##################################################################### + +qt_add_test(tst_webchannel + SOURCES + tst_webchannel.cpp tst_webchannel.h + INCLUDE_DIRECTORIES + ../../../src/webchannel + LIBRARIES + Qt::CorePrivate + Qt::WebChannelPrivate + PUBLIC_LIBRARIES + Qt::WebChannel +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_webchannel CONDITION TARGET Qt::Qml + DEFINES + WEBCHANNEL_TESTS_CAN_USE_JS_ENGINE + PUBLIC_LIBRARIES + Qt::Qml +) |