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 --- tests/CMakeLists.txt | 13 ++++++++++++ tests/auto/CMakeLists.txt | 10 ++++++++++ tests/auto/qml/CMakeLists.txt | 38 ++++++++++++++++++++++++++++++++++++ tests/auto/webchannel/CMakeLists.txt | 28 ++++++++++++++++++++++++++ 4 files changed, 89 insertions(+) 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 (limited to 'tests') 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