aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-08-30 13:13:37 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-09-02 11:23:38 +0000
commit729addd82ecb30825097961022d189e956a2e2cf (patch)
tree126efc5863e76eac0cfc08fd89d6372492a47ec4
parentb9a263faec1a0d94b76450a52c5ca07503e7e528 (diff)
Support standalone tests building
Also fix some build issues regarding tests. Change-Id: Ie9ba8a0b7932ae2b542614b6c824c4071ad0b548 Reviewed-by: Liang Qi <liang.qi@qt.io>
-rw-r--r--CMakeLists.txt5
-rw-r--r--src/qmldevtools/CMakeLists.txt1
-rw-r--r--tests/CMakeLists.txt19
-rw-r--r--tests/benchmarks/qml/qqmlcomponent/CMakeLists.txt2
4 files changed, 14 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 07da25c5b2..55b9a1943b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,6 +7,7 @@ project(QtDeclarative
LANGUAGES CXX C
)
-find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core Gui Widgets Network)
-find_package(Qt6 ${PROJECT_VERSION} CONFIG COMPONENTS Sql)
+find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core Gui Widgets Network
+ OPTIONAL_COMPONENTS Sql Concurrent)
+
qt_build_repo()
diff --git a/src/qmldevtools/CMakeLists.txt b/src/qmldevtools/CMakeLists.txt
index 7d516d8dc2..2a3c07147f 100644
--- a/src/qmldevtools/CMakeLists.txt
+++ b/src/qmldevtools/CMakeLists.txt
@@ -61,6 +61,7 @@ qt_process_qlalr("${CMAKE_CURRENT_SOURCE_DIR}/../qml/parser/qqmljs.g" QmlDevTool
qt_internal_module_info(qml_module "Qml")
set(_qml_dev_tools_private_includes
$<BUILD_INTERFACE:${qml_module_include_dir}>
+ $<BUILD_INTERFACE:${qml_module_repo_include_dir}>
$<BUILD_INTERFACE:${qml_module_include_dir}/${PROJECT_VERSION}>
$<BUILD_INTERFACE:${qml_module_include_dir}/${PROJECT_VERSION}/${qml_module}>
)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 33a89765dd..eeddbe0780 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,13 +1,12 @@
-# Generated from tests.pro.
-
# special case begin
-find_package(Qt6 REQUIRED Concurrent)
+if(NOT TARGET Qt::Test)
+ cmake_minimum_required(VERSION 3.15.0)
+ project(QtDeclarativeTests VERSION 6.0.0 LANGUAGES C CXX ASM)
+ find_package(Qt6 REQUIRED COMPONENTS BuildInternals Core Test Qml Quick QuickParticles
+ QmlDevTools QuickWidgets QmlDebug QuickTest QuickShapes
+ QmlWorkerScript Concurrent)
+ qt_set_up_standalone_tests_build()
+endif()
# special case end
-add_subdirectory(auto)
-# special case begin
-# benchmarks not yet ported
-# if(QT_CONFIG___contains___release)
-# add_subdirectory(benchmarks)
-# endif()
-# special case end
+qt_build_tests()
diff --git a/tests/benchmarks/qml/qqmlcomponent/CMakeLists.txt b/tests/benchmarks/qml/qqmlcomponent/CMakeLists.txt
index d54f1d09a5..442d405832 100644
--- a/tests/benchmarks/qml/qqmlcomponent/CMakeLists.txt
+++ b/tests/benchmarks/qml/qqmlcomponent/CMakeLists.txt
@@ -4,7 +4,7 @@
## tst_qqmlcomponent Binary:
#####################################################################
-add_qt_executable(tst_qqmlcomponent
+add_qt_executable(tst_qqmlcomponent_benchmark # special case avoid collision with auto test
GUI
SOURCES
testtypes.cpp testtypes.h