aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/cmake/qtquickcompiler/CMakeLists.txt
blob: c717ed01a38d6a6eb8b30aae5c5b96ae40f3cc81 (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

cmake_minimum_required(VERSION 3.16)
project(qqc_test)

find_package(Qt6 ${CMAKE_Core_MODULE_MAJOR_VERSION}.${CMAKE_Core_MODULE_MINOR_VERSION}
    REQUIRED COMPONENTS Qml Gui Test
)

set(CMAKE_AUTOMOC ON)

qt_add_executable(qqc_test
    # Absolute path needed to avoid using the copied file in the build dir.
    # That would still work, but it should use the file in the source dir.
    ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
)
target_link_libraries(qqc_test PRIVATE Qt6::Gui Qt6::Qml Qt6::Test)

set_source_files_properties("resources with space/main.qml" PROPERTIES
    QT_RESOURCE_ALIAS main.qml
)

qt_add_qml_module(qqc_test
    URI Test
    VERSION 1.0
    QML_FILES
        "resources with space/main.qml"
    RESOURCES
        main.cpp
)