From 902dfced06b73b92ae6cb9adc7a51acff0bcc936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCri=20Valdmann?= Date: Tue, 17 Sep 2019 11:43:34 +0200 Subject: Add cmake support Fixes: QTBUG-78190 Change-Id: Ibdfbcb479ce1af6370b9148516cef6f64e7c1abb Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor --- CMakeLists.txt | 13 +++++ coin/module_config.yaml | 13 +++++ examples/CMakeLists.txt | 7 +++ examples/webchannel/CMakeLists.txt | 18 +++++++ examples/webchannel/chatserver-cpp/CMakeLists.txt | 34 ++++++++++++ examples/webchannel/standalone/CMakeLists.txt | 45 ++++++++++++++++ src/CMakeLists.txt | 6 +++ src/imports/CMakeLists.txt | 3 ++ src/imports/webchannel/CMakeLists.txt | 26 +++++++++ src/imports/webchannel/webchannel.pro | 1 + src/webchannel/CMakeLists.txt | 64 +++++++++++++++++++++++ src/webchannel/webchannel.pro | 3 ++ tests/CMakeLists.txt | 13 +++++ tests/auto/CMakeLists.txt | 10 ++++ tests/auto/qml/CMakeLists.txt | 38 ++++++++++++++ tests/auto/webchannel/CMakeLists.txt | 28 ++++++++++ 16 files changed, 322 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 coin/module_config.yaml create mode 100644 examples/CMakeLists.txt create mode 100644 examples/webchannel/CMakeLists.txt create mode 100644 examples/webchannel/chatserver-cpp/CMakeLists.txt create mode 100644 examples/webchannel/standalone/CMakeLists.txt create mode 100644 src/CMakeLists.txt create mode 100644 src/imports/CMakeLists.txt create mode 100644 src/imports/webchannel/CMakeLists.txt create mode 100644 src/webchannel/CMakeLists.txt create mode 100644 tests/CMakeLists.txt create mode 100644 tests/auto/CMakeLists.txt create mode 100644 tests/auto/qml/CMakeLists.txt create mode 100644 tests/auto/webchannel/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..ed69eb2 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.15.0) + +project(QtWebChannel + VERSION 6.0.0 + DESCRIPTION "Qt WebChannel Libraries" + HOMEPAGE_URL "https://qt.io/" + LANGUAGES CXX C +) + +find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core) +find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS Quick Test QuickTest WebSockets) + +qt_build_repo() diff --git a/coin/module_config.yaml b/coin/module_config.yaml new file mode 100644 index 0000000..9f29e11 --- /dev/null +++ b/coin/module_config.yaml @@ -0,0 +1,13 @@ +version: 1 +accept_configuration: + condition: property + property: host.os + equals_property: target.os + +build_instructions: + - !include "{{qt/qtbase}}/prepare_building_env.yaml" + - !include "{{qt/qtbase}}/cmake_module_build_instructions.yaml" + - !include "{{qt/qtbase}}/cmake_build_and_upload_test_artifacts.yaml" + +test_instructions: + - !include "{{qt/qtbase}}/cmake_regular_test_instructions.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..afca841 --- /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") + +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/CMakeLists.txt b/examples/webchannel/standalone/CMakeLists.txt new file mode 100644 index 0000000..c915378 --- /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") + +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/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/CMakeLists.txt b/src/imports/webchannel/CMakeLists.txt new file mode 100644 index 0000000..fa48b81 --- /dev/null +++ b/src/imports/webchannel/CMakeLists.txt @@ -0,0 +1,26 @@ +# Generated from webchannel.pro. + +##################################################################### +## webchannel Plugin: +##################################################################### + +add_qml_module(declarative_webchannel # special case + URI "QtWebChannel" + VERSION "1.${CMAKE_PROJECT_VERSION_MINOR}" + CLASSNAME QWebChannelPlugin + SOURCES + plugin.cpp + INCLUDE_DIRECTORIES + ../../webchannel + LIBRARIES + Qt::WebChannelPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::Quick + Qt::WebChannel +) + +#### Keys ignored in scope 1:.:.:webchannel.pro:: +# IMPORT_VERSION = "1.$$QT_MINOR_VERSION" +# TARGETPATH = "QtWebChannel" +# _LOADED = "qml_plugin" 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..4f7f940 --- /dev/null +++ b/src/webchannel/CMakeLists.txt @@ -0,0 +1,64 @@ +# Generated from webchannel.pro. + +##################################################################### +## WebChannel Module: +##################################################################### + +add_qt_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 +) + +# 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) + +add_qt_resource(WebChannel "resources" + PREFIX + "/qtwebchannel/" + FILES + ${resources_resource_files} +) + + +#### Keys ignored in scope 1:.:.:webchannel.pro:: +# OTHER_FILES = "qwebchannel.js" +# _LOADED = "qt_module" + +## Scopes: +##################################################################### + +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" + +extend_target(WebChannel CONDITION NOT TARGET Qt::Qml + DEFINES + QT_NO_JSVALUE +) +add_qt_docs( + 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/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 0000000..6755718 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from tests.pro. + +# special case begin +if(NOT TARGET Qt::Test) + cmake_minimum_required(VERSION 3.15.0) + project(QtWebChannelTests VERSION 6.0.0 LANGUAGES C CXX) + find_package(Qt6 ${PROJECT_VERSION} REQUIRED COMPONENTS BuildInternals Core Test WebChannel) + find_package(Qt6 ${PROJECT_VERSION} OPTIONAL_COMPONENTS Quick QuickTest) + qt_set_up_standalone_tests_build() +endif() +# special case end + +qt_build_tests() 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..e49bd8c --- /dev/null +++ b/tests/auto/qml/CMakeLists.txt @@ -0,0 +1,38 @@ +# 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}) + +add_qt_test(qml + GUI + 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:: +# 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..aa040f8 --- /dev/null +++ b/tests/auto/webchannel/CMakeLists.txt @@ -0,0 +1,28 @@ +# Generated from webchannel.pro. + +##################################################################### +## tst_webchannel Test: +##################################################################### + +add_qt_test(tst_webchannel + GUI + SOURCES + tst_webchannel.cpp tst_webchannel.h + INCLUDE_DIRECTORIES + ../../../src/webchannel + LIBRARIES + Qt::CorePrivate + Qt::WebChannelPrivate + PUBLIC_LIBRARIES + Qt::WebChannel +) + +## Scopes: +##################################################################### + +extend_target(tst_webchannel CONDITION TARGET Qt::Qml + DEFINES + WEBCHANNEL_TESTS_CAN_USE_JS_ENGINE + PUBLIC_LIBRARIES + Qt::Qml +) -- cgit v1.2.1 From 3c3d168487b10e7e4d7c06df5a28df9d4220b6de Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 18 Nov 2019 18:24:06 +0100 Subject: Regenerate projects Change-Id: Ibdadef34b1b7d4ea98140feed171c409eb8bafde Reviewed-by: Qt CMake Build Bot Reviewed-by: Leander Beernaert Reviewed-by: Simon Hausmann --- .prev_CMakeLists.txt | 15 ++++++++ CMakeLists.txt | 6 ++- examples/webchannel/chatserver-cpp/CMakeLists.txt | 2 +- .../webchannel/standalone/.prev_CMakeLists.txt | 44 ++++++++++++++++++++++ examples/webchannel/standalone/CMakeLists.txt | 2 +- src/imports/webchannel/.prev_CMakeLists.txt | 26 +++++++++++++ src/imports/webchannel/CMakeLists.txt | 4 +- src/webchannel/CMakeLists.txt | 11 +++--- tests/auto/qml/CMakeLists.txt | 6 +-- tests/auto/webchannel/CMakeLists.txt | 5 +-- 10 files changed, 102 insertions(+), 19 deletions(-) create mode 100644 .prev_CMakeLists.txt create mode 100644 examples/webchannel/standalone/.prev_CMakeLists.txt create mode 100644 src/imports/webchannel/.prev_CMakeLists.txt diff --git a/.prev_CMakeLists.txt b/.prev_CMakeLists.txt new file mode 100644 index 0000000..bba8c8d --- /dev/null +++ b/.prev_CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from qtwebchannel.pro. + +cmake_minimum_required(VERSION 3.15.0) + +project(QtWebChannel + VERSION 6.0.0 + 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) + +qt_build_repo() diff --git a/CMakeLists.txt b/CMakeLists.txt index ed69eb2..ce62c3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,5 @@ +# Generated from qtwebchannel.pro. + cmake_minimum_required(VERSION 3.15.0) project(QtWebChannel @@ -7,7 +9,7 @@ project(QtWebChannel LANGUAGES CXX C ) -find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core) -find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS Quick Test QuickTest WebSockets) +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 qt_build_repo() diff --git a/examples/webchannel/chatserver-cpp/CMakeLists.txt b/examples/webchannel/chatserver-cpp/CMakeLists.txt index afca841..3a3a2c9 100644 --- a/examples/webchannel/chatserver-cpp/CMakeLists.txt +++ b/examples/webchannel/chatserver-cpp/CMakeLists.txt @@ -9,7 +9,7 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) -set(INSTALL_EXAMPLEDIR "examples") +set(INSTALL_EXAMPLEDIR "examples/webchannel/chatserver-cpp") find_package(Qt6 COMPONENTS Core) find_package(Qt6 COMPONENTS WebSockets) 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 index c915378..78977cd 100644 --- a/examples/webchannel/standalone/CMakeLists.txt +++ b/examples/webchannel/standalone/CMakeLists.txt @@ -9,7 +9,7 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) -set(INSTALL_EXAMPLEDIR "examples") +set(INSTALL_EXAMPLEDIR "examples/webchannel/standalone") find_package(Qt6 COMPONENTS Core) find_package(Qt6 COMPONENTS Gui) diff --git a/src/imports/webchannel/.prev_CMakeLists.txt b/src/imports/webchannel/.prev_CMakeLists.txt new file mode 100644 index 0000000..a616eb8 --- /dev/null +++ b/src/imports/webchannel/.prev_CMakeLists.txt @@ -0,0 +1,26 @@ +# Generated from webchannel.pro. + +##################################################################### +## webchannel Plugin: +##################################################################### + +qt_add_qml_module(webchannel + URI "QtWebChannel" + VERSION "1.${CMAKE_PROJECT_VERSION_MINOR}" + CLASSNAME QWebChannelPlugin + SKIP_TYPE_REGISTRATION + SOURCES + plugin.cpp + INCLUDE_DIRECTORIES + ../../webchannel + LIBRARIES + Qt::WebChannelPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::Quick + Qt::WebChannel +) + +#### Keys ignored in scope 1:.:.:webchannel.pro:: +# IMPORT_VERSION = "1.$$QT_MINOR_VERSION" +# TARGETPATH = "QtWebChannel" diff --git a/src/imports/webchannel/CMakeLists.txt b/src/imports/webchannel/CMakeLists.txt index fa48b81..d4986a9 100644 --- a/src/imports/webchannel/CMakeLists.txt +++ b/src/imports/webchannel/CMakeLists.txt @@ -4,10 +4,11 @@ ## webchannel Plugin: ##################################################################### -add_qml_module(declarative_webchannel # special case +qt_add_qml_module(declarative_webchannel # special case URI "QtWebChannel" VERSION "1.${CMAKE_PROJECT_VERSION_MINOR}" CLASSNAME QWebChannelPlugin + SKIP_TYPE_REGISTRATION SOURCES plugin.cpp INCLUDE_DIRECTORIES @@ -23,4 +24,3 @@ add_qml_module(declarative_webchannel # special case #### Keys ignored in scope 1:.:.:webchannel.pro:: # IMPORT_VERSION = "1.$$QT_MINOR_VERSION" # TARGETPATH = "QtWebChannel" -# _LOADED = "qml_plugin" diff --git a/src/webchannel/CMakeLists.txt b/src/webchannel/CMakeLists.txt index 4f7f940..45c0373 100644 --- a/src/webchannel/CMakeLists.txt +++ b/src/webchannel/CMakeLists.txt @@ -4,7 +4,7 @@ ## WebChannel Module: ##################################################################### -add_qt_module(WebChannel +qt_add_module(WebChannel SOURCES qmetaobjectpublisher.cpp qmetaobjectpublisher_p.h qwebchannel.cpp qwebchannel.h qwebchannel_p.h @@ -27,7 +27,7 @@ set(resources_resource_files set_source_files_properties(${resources_resource_files} PROPERTIES QT_SKIP_QUICKCOMPILER 1) -add_qt_resource(WebChannel "resources" +qt_add_resource(WebChannel "resources" PREFIX "/qtwebchannel/" FILES @@ -37,12 +37,11 @@ add_qt_resource(WebChannel "resources" #### Keys ignored in scope 1:.:.:webchannel.pro:: # OTHER_FILES = "qwebchannel.js" -# _LOADED = "qt_module" ## Scopes: ##################################################################### -extend_target(WebChannel CONDITION TARGET Qt::Qml +qt_extend_target(WebChannel CONDITION TARGET Qt::Qml SOURCES qqmlwebchannel.cpp qqmlwebchannelattached.cpp @@ -54,11 +53,11 @@ extend_target(WebChannel CONDITION TARGET Qt::Qml # PRIVATE_HEADERS = "qqmlwebchannelattached_p.h" # PUBLIC_HEADERS = "qqmlwebchannel.h" -extend_target(WebChannel CONDITION NOT TARGET Qt::Qml +qt_extend_target(WebChannel CONDITION NOT TARGET Qt::Qml DEFINES QT_NO_JSVALUE ) -add_qt_docs( +qt_add_docs(WebChannel doc/qtwebchannel.qdocconf ) diff --git a/tests/auto/qml/CMakeLists.txt b/tests/auto/qml/CMakeLists.txt index e49bd8c..3b6013f 100644 --- a/tests/auto/qml/CMakeLists.txt +++ b/tests/auto/qml/CMakeLists.txt @@ -5,14 +5,12 @@ ##################################################################### # Collect test data - file(GLOB_RECURSE test_data_glob RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} - "data/*") + data/*) list(APPEND test_data ${test_data_glob}) -add_qt_test(qml - GUI +qt_add_test(qml QMLTEST QML_IMPORTPATH "${CMAKE_CURRENT_BINARY_DIR}/../../../qml" diff --git a/tests/auto/webchannel/CMakeLists.txt b/tests/auto/webchannel/CMakeLists.txt index aa040f8..1f7d734 100644 --- a/tests/auto/webchannel/CMakeLists.txt +++ b/tests/auto/webchannel/CMakeLists.txt @@ -4,8 +4,7 @@ ## tst_webchannel Test: ##################################################################### -add_qt_test(tst_webchannel - GUI +qt_add_test(tst_webchannel SOURCES tst_webchannel.cpp tst_webchannel.h INCLUDE_DIRECTORIES @@ -20,7 +19,7 @@ add_qt_test(tst_webchannel ## Scopes: ##################################################################### -extend_target(tst_webchannel CONDITION TARGET Qt::Qml +qt_extend_target(tst_webchannel CONDITION TARGET Qt::Qml DEFINES WEBCHANNEL_TESTS_CAN_USE_JS_ENGINE PUBLIC_LIBRARIES -- cgit v1.2.1