ToyCustomizer: Include asset CMakeLists.txt files from target's directory


animations/, images/ and meshes/ subdirectories were added via
add_subdirectory() and each called qt_target_qml_sources() locally, even
though the toycustomizer target is defined in the parent CMakeLists.txt.
Qt6QmlMacros.cmake requires this function to be called from the target's
own directory scope when using the Xcode or Unix Makefiles generators,
so configuring the example with Xcode generator (as used for iOS builds)
failed with a directory scope error.

Switch from add_subdirectory() to include() for animations/, fonts/,
images/ and meshes/ CMakeLists.txt files, since include() does not open
a new directory scope. The file lists in each included file now include
their own subdirectory name, since CMAKE_CURRENT_SOURCE_DIR no longer
changes per file. The icons under images/icons/ additionally need
QT_RESOURCE_ALIAS set to keep their resource path free of the "images/"
segment, matching the existing QML references.

Fixes: QTBUG-142754
Pick-to: 6.12 6.11
Change-Id: Ic7625732edff9ff5821f087cdf6fefc5c6f04618
Reviewed-by: MohammadHossein Qanbari <mohammad.qanbari@qt.io>
commitd3acab6a5846f85b0c268ee69bf47bf327afe78d
parenta886553eaf0ae89795609950b1163ddceec9435c
authorDilek Akcay <dilek.akcay@qt.io>
committerDilek Akcay <dilek.akcay@qt.io>
commit timeThu, 6 Aug 2026 10:11:49 +0000