summaryrefslogtreecommitdiff
path: root/src/svg/.prev_CMakeLists.txt
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-02-25 11:27:17 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-03-06 00:31:50 +0100
commit7ad4f9db2700db57352fae98631bade347567ebd (patch)
tree947865d612f1b878150bc4e45171583a1658b3c0 /src/svg/.prev_CMakeLists.txt
parent53a7436262a5bb6a96026b576e2660efb718b2b5 (diff)
downloadqtsvg-7ad4f9db2700db57352fae98631bade347567ebd.tar.gz
CMake: Handle zlib dependency correctly
Unfortunately whenever a module or plugin uses zlib, the .pro file contains a copy-pasted conditional scope when to use system zlib and when to use the Qt bundled zlib. The pro2cmake script handles the linking part, but not the find_package part. We need to explicitly search for the correct package depending on whether system zlib feature is on or off, and also make sure not to search for the system one in case it already exists (can happen in static builds). Change-Id: I9c0d678815e4dc0f8e239c3b4667a375aeb757c1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/svg/.prev_CMakeLists.txt')
-rw-r--r--src/svg/.prev_CMakeLists.txt11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/svg/.prev_CMakeLists.txt b/src/svg/.prev_CMakeLists.txt
index 30ed3e1..bf9e056 100644
--- a/src/svg/.prev_CMakeLists.txt
+++ b/src/svg/.prev_CMakeLists.txt
@@ -23,7 +23,6 @@ qt_add_module(Svg
LIBRARIES
Qt::CorePrivate
Qt::GuiPrivate
- ZLIB::ZLIB
PUBLIC_LIBRARIES
Qt::Core
Qt::Gui
@@ -51,6 +50,16 @@ qt_extend_target(Svg CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i386")
#### Keys ignored in scope 4:.:.:svg.pro:solaris-cc_x_:
# QMAKE_CXXFLAGS_RELEASE = "--O2"
+
+qt_extend_target(Svg CONDITION QT_FEATURE_system_zlib
+ LIBRARIES
+ ZLIB::ZLIB
+)
+
+qt_extend_target(Svg CONDITION NOT QT_FEATURE_system_zlib
+ LIBRARIES
+ Qt::ZlibPrivate
+)
qt_add_docs(Svg
doc/qtsvg.qdocconf
)