summaryrefslogtreecommitdiffstats
path: root/tests/CMakeLists.txt
blob: f8a8c705d7795f4695150c1c6497ed120b2a44a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause

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

# special case begin

# It should be possible to build the tests/CMakeLists.txt project as a standalone project
# (not via qtqa/CMakeLists.txt + QT_BUILD_STANDALONE_TESTS) because that's what Coin does
# with qmake.
# This is somewhat similar to qtbase/src/plugins/sqldrivers.
if(NOT QT_BUILD_STANDALONE_TESTS AND CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
    cmake_minimum_required(VERSION 3.16)
    include(../.cmake.conf)
    project(QtQualityAssuranceTests
        VERSION "${QT_REPO_MODULE_VERSION}"
        DESCRIPTION "Qt6 Quality Assurance tests"
        HOMEPAGE_URL "https://qt.io/"
        LANGUAGES CXX C
    )
    find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core Test)
    find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS Gui Widgets)
    qt_prepare_standalone_project()
    set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/fake_install_prefix" CACHE STRING "" FORCE)
endif()

# We can't use qt_build_tests because the test folder layout is different,
# so we need to copy paste some of the functionality.
if(QT_BUILD_STANDALONE_TESTS)
    qt_set_language_standards()
    if(NOT QT_SUPERBUILD)
        qt_internal_set_up_fake_standalone_parts_install_prefix()
    endif()
endif()

# add_subdirector(prebuild) # TODO Port if needed
add_subdirectory(postbuild)

# special case end