qt5base-lts/tests/auto/tools/rcc/CMakeLists.txt
Joerg Bornemann 92185d417d Fix BASE argument of qt_add_resources
The BASE argument of qt_add_resources now denotes the root point of the
alias of the file.  Before, BASE was merely prepended to every file that
got passed to qt_add_resources.

Old behavior:
    qt_add_resources(app "images"
        PREFIX "/"
        BASE "../shared"
        FILES "images/button.png")

Alias is "../shared/images/button.png", and pro2cmake generated
QT_RESOURCE_ALIAS assignments to fix this.

New behavior:
    qt_add_resources(app "images"
        PREFIX "/"
        BASE "../shared"
        FILES "../shared/images/button.png")

The alias is "images/button.png".  No extra QT_RESOURCE_ALIAS assignment
is needed.

The new behavior is in effect for user projects and for Qt repositories
that define QT_USE_FIXED_QT_ADD_RESOURCE_BASE.  Qt repositories will be
ported one by one to this new behavior.  Then the old code path can be
removed.

Pick-to: 6.1
Task-number: QTBUG-86726
Change-Id: Ib895edd4df8e97b54badadd9a1c34408beff131f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-18 16:02:52 +02:00

66 lines
1.2 KiB
CMake

# Generated from rcc.pro.
#####################################################################
## tst_rcc Test:
#####################################################################
qt_internal_add_test(tst_rcc
SOURCES
tst_rcc.cpp
)
# Resources:
set(images_resource_files
"data/images/images/circle.png"
"data/images/images/square.png"
"data/images/images/subdir/triangle.png"
)
qt_internal_add_resource(tst_rcc "images"
PREFIX
"/"
BASE
"data/images"
FILES
${images_resource_files}
)
set(size-0_resource_files
"data/sizes/data/data-0.txt"
)
qt_internal_add_resource(tst_rcc "size-0"
PREFIX
"/"
BASE
"data/sizes"
FILES
${size-0_resource_files}
)
set(size-2-0-35-1_resource_files
"data/sizes/data/data-0.txt"
"data/sizes/data/data-1.txt"
"data/sizes/data/data-2.txt"
"data/sizes/data/data-35.txt"
)
qt_internal_add_resource(tst_rcc "size-2-0-35-1"
PREFIX
"/"
BASE
"data/sizes"
FILES
${size-2-0-35-1_resource_files}
)
set(size-1_resource_files
"data/sizes/data/data-1.txt"
)
qt_internal_add_resource(tst_rcc "size-1"
PREFIX
"/"
BASE
"data/sizes"
FILES
${size-1_resource_files}
)