Support standalone tests building

Also fix some build issues regarding tests.

Change-Id: Ie9ba8a0b7932ae2b542614b6c824c4071ad0b548
Reviewed-by: Liang Qi <liang.qi@qt.io>
This commit is contained in:
Liang Qi 2019-08-30 13:13:37 +02:00 committed by Alexandru Croitor
parent b9a263faec
commit 729addd82e
4 changed files with 14 additions and 13 deletions

View File

@ -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()

View File

@ -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}>
)

View File

@ -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()

View File

@ -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