qt5base-lts/tests/baseline/painting/CMakeLists.txt
Marc Mutz 11d6932560 Mark all of Qt as free of Q_FOREACH, except where it isn't
The density of Q_FOREACH uses in this and some other modules is still
extremely high, too high for anyone to tackle in a short amount of
time. Even if they're not concentrated in just a few TUs, we need to
make progress on a global QT_NO_FOREACH default, so grab the nettle
and stick to our strategy:

Mark the whole of Qt with QT_NO_FOREACH, to prevent new uses from
creeping in, and whitelist the affected TUs by #undef'ing
QT_NO_FOREACH locally, at the top of each file. For TUs that are part
of a larger executable, this requires these files to be compiled
separately, so add them to NO_PCH_SOURCES (which implies
NO_UNITY_BUILD_SOURCES, too).

In tst_qglobal.cpp and tst_qcollections.cpp change the comment on the
#undef QT_NO_FOREACH to indicate that these actually test the macro.

Task-number: QTBUG-115839
Change-Id: Iecc444eb7d43d7e4d037f6e155abe0e14a00a5d6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-08-19 05:19:42 +00:00

79 lines
2.0 KiB
CMake

# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_baseline_painting Test:
#####################################################################
# Collect test data
file(GLOB_RECURSE test_data_glob
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
scripts/*)
list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_baseline_painting
SOURCES
../shared/baselineprotocol.cpp ../shared/baselineprotocol.h ../shared/lookup3.cpp
../shared/qbaselinetest.cpp ../shared/qbaselinetest.h
../shared/paintcommands.cpp ../shared/paintcommands.h
tst_baseline_painting.cpp
NO_PCH_SOURCES
tst_baseline_painting.cpp # undef QT_NO_FOREACH
INCLUDE_DIRECTORIES
../shared
LIBRARIES
Qt::Gui
Qt::GuiPrivate
Qt::Network
TESTDATA ${test_data}
)
# Resources:
set(images_resource_files
"images/alpha.png"
"images/alpha2x2.png"
"images/bitmap.png"
"images/border.png"
"images/borderimage.png"
"images/dome_argb32.png"
"images/dome_indexed.png"
"images/dome_indexed_mask.png"
"images/dome_mono.png"
"images/dome_mono_128.png"
"images/dome_mono_palette.png"
"images/dome_rgb32.png"
"images/dot.png"
"images/face.png"
"images/gam030.png"
"images/gam045.png"
"images/gam056.png"
"images/gam100.png"
"images/gam200.png"
"images/image.png"
"images/mask.png"
"images/mask_100.png"
"images/masked.png"
"images/sign.png"
"images/solid.png"
"images/solid2x2.png"
"images/struct-image-01.jpg"
"images/struct-image-01.png"
"images/zebra.png"
)
qt_internal_add_resource(tst_baseline_painting "images"
PREFIX
"/"
FILES
${images_resource_files}
)
## Scopes:
#####################################################################
qt_internal_extend_target(tst_baseline_painting CONDITION QT_FEATURE_opengl
LIBRARIES
Qt::OpenGL
)