CMake: Remove the bundled-zlib in-tree examples workaround


The pre-loading of Qt6ZlibPrivate in qtsvg's top-level CMakeLists.txt
was a 2022 workaround for the case where examples are built in-tree
against a Qt configured with -qt-zlib. At the time, the examples
machinery set QT_NO_CREATE_TARGETS=TRUE globally, which caused
Qt6SvgDependencies.cmake's find_dependency(Qt6ZlibPrivate) to fail
with Qt6ZlibPrivate_FOUND=FALSE because Qt6ZlibPrivateConfig.cmake
short-circuited and never observed the build-time Qt6::ZlibPrivate
target.

Since the per-package TargetsPrecheck mechanism landed in qtbase, the
ZlibPrivate config self-detects the existing build-time target via
_qt_internal_check_multiple_inclusion and Qt6ZlibPrivate_FOUND is set
from the TARGET existence check rather than from including
Qt6ZlibPrivateTargets.cmake. The workaround is no longer required.

Verified with a top-level qtbase+qtsvg developer build configured with
-no-feature-system-zlib and QT_BUILD_EXAMPLES_AS_EXTERNAL=OFF: the
svgviewer example's find_package(Qt6 REQUIRED COMPONENTS Svg) resolves
cleanly without the pre-load.

Task-number: QTBUG-135233
Change-Id: Ic61262419cb48da803e643235a613441197bf518
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
commit991236afc36ed8a2f8c6709291a97fef5aa5d51d
parent133a4318f549d5462bd491b1bbdb15621c21792d
authorJoerg Bornemann <joerg.bornemann@qt.io>
committerJoerg Bornemann <joerg.bornemann@qt.io>
commit timeWed, 20 May 2026 13:06:34 +0000