aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmltc_qprocess/CMakeLists.txt
blob: 9e951c4aeb786ba254ea611f2c8e2c02d265eb80 (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

qt_internal_add_test(tst_qmltc_qprocess
    SOURCES
        tst_qmltc_qprocess.cpp
    LIBRARIES
        Qt::Core
        Qt::Qml
        Qt::QuickTestUtilsPrivate
)
qt6_add_qml_module(tst_qmltc_qprocess
    VERSION 1.0
    URI QmltcQProcessTests
    AUTO_RESOURCE_PREFIX
    QML_FILES
        data/dummy.qml
        data/inlineComponent.qml
        data/SingletonThing.qml
        data/erroneousFile.qml
)
# special setup for singleton files:
set_source_files_properties(SingletonThing.qml PROPERTIES QT_QML_SINGLETON_TYPE true)

add_dependencies(tst_qmltc_qprocess Qt::qmltc)

# fetch --resource arguments manually (mimics the logic of qmltc compilation
# command)
_qt_internal_genex_getjoinedproperty(qrc_args tst_qmltc_qprocess
    _qt_generated_qrc_files "" "_::_"
)
target_compile_definitions(tst_qmltc_qprocess PRIVATE
    TST_QMLTC_QPROCESS_RESOURCES="${qrc_args}"
)

qt_internal_extend_target(tst_qmltc_qprocess CONDITION ANDROID OR IOS
    DEFINES
        QT_QMLTEST_DATADIR=\\\":/data\\\"
)

qt_internal_extend_target(tst_qmltc_qprocess CONDITION NOT ANDROID AND NOT IOS
    DEFINES
        QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
)