CMake: Fix linkage to correct ZLIB


Depending on whether we use system zlib or qt zlib, we need to link
the correct target.

Also remove the bare linkage to ZLIB::ZLIB in tests, in principle we
don't need it anymore, because we only need it for the Common library.

Change-Id: I2cda2e0c7e02150b7e3e66d617072ccf3cedbdeb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
commitc0624d4770c2c07b3e6abf76c48de786c0577cbc
parent4c074f0d6b12bfc34e8357fa41aa6b3d9a523acc
authorAlexandru Croitor <alexandru.croitor@qt.io>
committerTatiana Borisova <tatiana.borisova@qt.io>
commit timeMon, 1 Dec 2025 19:15:43 +0100