diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2022-02-21 15:36:09 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2022-03-10 15:38:43 +0100 |
commit | 71556f51d88199f1f5258a560d588df4d9aed7ca (patch) | |
tree | 26fe444a90eb0a8c99ad99e8b55288801ff789a1 /examples/svg/embedded/CMakeLists.txt | |
parent | 2503453da04181a350e2a2833fe0fdcd6e6141c4 (diff) | |
download | qtsvg-71556f51d88199f1f5258a560d588df4d9aed7ca.tar.gz |
CMake: Fix finding bundled svg with an in-tree examples build
When Qt is configure with -qt-zlib (like our Windows configs in CI) we
create a QtZlibPrivate target and install it.
QtSvg depends on this targets.
When building examples in-tree (not as external projects)
find_package(Qt6Svg) in the example projects will call
find_dependency(Qt6Zlib).
Currently that will fail with
Found package configuration file:
lib/cmake/Qt6ZlibPrivate/Qt6ZlibPrivateConfig.cmake
but it set Qt6ZlibPrivate_FOUND to FALSE so package "Qt6ZlibPrivate"
is considered to be NOT FOUND. Reason given by package:
Target "Qt6::ZlibPrivate" was not found. Possibly due to
QT_NO_CREATE_TARGETS being set to TRUE
It's true, we set QT_NO_CREATE_TARGETS to FALSE when configuring
examples, to prevent duplicate target creation.
But the Zlib target was not created, because we didn't find_package
it explicitly before configuring examples.
Work around it by explicitly looking for the package before examples
are built.
Pick-to: 6.2 6.3
Change-Id: If5c474d62a2939bc32373b2e92d3151f377f51bc
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Diffstat (limited to 'examples/svg/embedded/CMakeLists.txt')
0 files changed, 0 insertions, 0 deletions