aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmltc/QmltcTests/CMakeLists.txt
blob: 4c472ec4ab20a477db1071775a66fa1a2b51d949 (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause

set(cpp_sources
    # attached types:
    cpptypes/testattachedtype.h cpptypes/testattachedtype.cpp
    # grouped types:
    cpptypes/testgroupedtype.h cpptypes/testgroupedtype.cpp
    # private properties:
    cpptypes/testprivateproperty.h cpptypes/testprivateproperty.cpp
    cpptypes/private/testprivateproperty_p.h

    cpptypes/typewithproperties.h cpptypes/typewithproperties.cpp
    # deferred:
    cpptypes/deferredpropertytypes.h cpptypes/deferredpropertytypes.cpp
    # extension types:
    cpptypes/extensiontypes.h cpptypes/extensiontypes.cpp

    cpptypes/typewithspecialproperties.h

    cpptypes/typewithmanyproperties.h
    cpptypes/singletontype.h cpptypes/singletontype.cpp
    cpptypes/typewithnamespace.h cpptypes/typewithnamespace.cpp
    cpptypes/typewithsignal.h
    cpptypes/custominitialization.h
    cpptypes/typewithrequiredproperties.h
)

set(qml_sources
    HelloWorld.qml
    NameConflict.qml
    simpleQtQuickTypes.qml
    typeWithEnums.qml
    methods.qml
    properties.qml
    ObjectWithId.qml
    documentWithIds.qml
    importNamespace.qml
    gradients.qml
    qjsvalueAssignments.qml
    QmlTypeWithExtension.qml
    QmlTypeWithBaseTypeExtension.qml
    extensionTypeBindings.qml
    nonStandardInclude.qml
    specialProperties.qml
    regexpBindings.qml
    AliasBase.qml
    aliasAssignments.qml
    Connections.qml

    qtbug103956/SubComponent.qml
    qtbug103956/MainComponent.qml
    qtbug103956/qtbug103956_main.qml

    qtbug120700_main.qml

    qtbug123476.qml

    signalHandlers.qml
    javaScriptFunctions.qml
    changingBindings.qml
    propertyAlias.qml
    propertyAliasAttributes.qml
    propertyAlias_external.qml
    propertyChangeHandler.qml
    NestedHelloWorld.qml
    ComponentHelloWorld.qml
    listProperty.qml
    listPropertySameName.qml
    defaultProperty.qml
    defaultPropertyCorrectSelection.qml
    defaultAlias.qml
    propertyReturningFunction.qml
    AttachedProperty.qml
    attachedPropertyDerived.qml
    groupedProperty.qml
    groupedProperty_qquicktext.qml
    localImport.qml
    localImport_explicit.qml
    newPropertyBoundToOld.qml
    oldPropertyBoundToNew.qml
    nonLocalQmlPropertyBoundToAny.qml
    localDerived.qml
    justAnimation.qml
    justAnimationOnAlias.qml
    behaviorAndAnimation.qml
    behaviorAndAnimationOnAlias.qml
    singletonUser.qml
    bindingsThroughIds.qml
    localImport_context.qml
    neighbors_context.qml
    delegate_context.qml
    nontrivial_context.qml
    javascriptCaller.qml
    listView.qml
    bindingOnValueType.qml
    keyEvents.qml
    complexAliases.qml
    PrivateProperty.qml
    privatePropertySubclass.qml
    calqlatrBits.qml
    propertyChangeAndSignalHandlers.qml
    deferredProperties.qml
    deferredProperties_group.qml
    deferredProperties_attached.qml
    deferredProperties_complex.qml
    valueTypeListProperty.qml
    translations.qml
    translationsById.qml
    generalizedGroupedProperty.qml
    appendToQQmlListProperty.qml
    inlineComponents.qml
    repeaterCrash.qml
    aliases.qml
    inlineComponentsFromDifferentFiles.qml
    singletons.qml
    mySignals.qml
    stringToUrl.qml
    myCheckBox.qml
    signalConnections.qml

    # support types:
    DefaultPropertySingleChild.qml
    DefaultPropertyAliasChild.qml
    DefaultPropertyManyChildren.qml
    LocallyImported.qml
    LocalWithOnCompleted.qml
    LocallyImported_context.qml
    ComponentWithAlias1.qml
    ComponentWithAlias2.qml
    ComponentWithAlias3.qml
    SingletonThing.qml
    InlineComponentProvider.qml
    InlineComponentReexporter.qml
    NamespacedTypes.qml

    badFile.qml

    requiredProperties.qml
)

set(js_sources
    subfolder/code.js
)

set(common_libraries
    Qt::Core
    Qt::QmlPrivate
    Qt::QuickPrivate
    Qt::QuickTemplates2Private
    Qt::TestPrivate
    Qt::Gui # QColor, QMatrix4x4, ...
)

if (QT_FEATURE_qml_table_model)
    list(APPEND qml_sources QmlTableModel.qml)
    list(APPEND common_libraries Qt::LabsQmlModelsPrivate)
endif()

set_source_files_properties(NameConflict.qml PROPERTIES
    QT_QMLTC_FILE_BASENAME ResolvedNameConflict)

set_source_files_properties(badFile.qml PROPERTIES QT_QML_SKIP_TYPE_COMPILER TRUE)

set_source_files_properties(SingletonThing.qml PROPERTIES
   QT_QML_SINGLETON_TYPE true)

qt_add_library(qmltc_test_module STATIC)
qt_autogen_tools_initial_setup(qmltc_test_module)

# use PUBLIC everywhere to simplify the build of the test binary
target_include_directories(qmltc_test_module PUBLIC cpptypes/)
target_link_libraries(qmltc_test_module PUBLIC ${common_libraries})

# Resources:
set(qmake_immediate_resource_files
    "translations_ge.qm"
    "translationsById_ge.qm"
)
qt_internal_add_resource(qmltc_test_module "qmake_immediate"
    PREFIX
        "/i18n"
    FILES
        ${qmake_immediate_resource_files}
)

qt_policy(SET QTP0001 NEW)

qt6_add_qml_module(qmltc_test_module
    VERSION 1.0
    URI QmltcTests
    SOURCES
        ${cpp_sources}
    QML_FILES
        ${qml_sources}
        ${js_sources}
    DEPENDENCIES
        QtQuick
    LIBRARIES
        qmltc_test_module_translation_by_id
    ENABLE_TYPE_COMPILER
)

qt_autogen_tools_initial_setup(qmltc_test_moduleplugin)