blob: a86cc8e76a5adabcc5efebd64fff6489a5d8ce47 (
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
|
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_qresourceengine Test:
#####################################################################
if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
cmake_minimum_required(VERSION 3.16)
project(tst_qresourceengine LANGUAGES C CXX ASM)
find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
endif()
# Collect test data
set(test_data "parentdir.txt")
file(GLOB_RECURSE test_data_glob
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
testqrc/*)
list(APPEND test_data ${test_data_glob})
file(GLOB_RECURSE test_data_glob
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
*.rcc)
list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qresourceengine
SOURCES
tst_qresourceengine.cpp
LIBRARIES
Qt::CorePrivate
moctestplugin
TESTDATA ${test_data}
)
set_source_files_properties("world.txt"
PROPERTIES QT_DISCARD_FILE_CONTENTS TRUE
)
qt_internal_add_resource(tst_qresourceengine "qt_resource_empty"
PREFIX
"/empty"
FILES
"world.txt"
)
qt_add_resources(additional_sources testqrc/test.qrc)
target_sources(tst_qresourceengine PRIVATE ${additional_sources})
if(ANDROID)
qt_add_resources(additional_sources android_testdata.qrc)
target_sources(tst_qresourceengine PRIVATE ${additional_sources})
endif()
qt_add_binary_resources(tst_qresourceengine_runtime_resource "testqrc/test.qrc"
DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/runtime_resource.rcc"
OPTIONS -root "/runtime_resource/" -binary)
add_dependencies(tst_qresourceengine tst_qresourceengine_runtime_resource)
add_subdirectory(staticplugin)
|