stachenov / quazip

Qt/C++ wrapper over minizip
Other
582 stars 232 forks source link

Use the BundledZLIB component when compiling for Qt 6.3.1 and higher #171

Closed aikawayataro closed 1 year ago

aikawayataro commented 1 year ago

Fixes #146 #170

Qt Zlib has been refactored into a static BundledZLIB component. (https://codereview.qt-project.org/c/qt/qtbase/+/403618) This change was introduced in Qt 6.3.1

cosmarc commented 1 year ago

Trying to compile your changes on Windows 11 with Qt 6.4.3 and the package is not found:

PS C:\quazip> cmake -S . -B build -D QUAZIP_QT_MAJOR_VERSION=6 -D QUAZIP_USE_QT_ZLIB=ON
-- Selecting Windows SDK version 10.0.20348.0 to target Windows 10.0.22621.
-- The C compiler identification is MSVC 19.29.30148.0
-- The CXX compiler identification is MSVC 19.29.30148.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using Qt version 6
-- Could NOT find Qt6BundledZLIB (missing: Qt6BundledZLIB_DIR)
CMake Warning at C:/Qt/6.4.3/msvc2019_64/lib/cmake/Qt6/Qt6Config.cmake:214 (message):
  Failed to find optional Qt component "BundledZLIB".

  Expected Config file at
  "C:/Qt/6.4.3/msvc2019_64/lib/cmake/Qt6BundledZLIB/Qt6BundledZLIBConfig.cmake"
  does NOT exist

Call Stack (most recent call first):
  CMakeLists.txt:108 (find_package)

CMake Error at C:/Program Files/CMake/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files/CMake/share/cmake-3.26/Modules/FindZLIB.cmake:200 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:141 (find_package)

-- Configuring incomplete, errors occurred!
aikawayataro commented 1 year ago

Trying to compile your changes on Windows 11 with Qt 6.4.3 and the package is not found:

Your Qt must be configured with the -qt-zlib parameter As far as i know Qt Installer builds is compiled with dynamic zlib

cosmarc commented 1 year ago

Ah, got it now. I just downloaded and installed Qt using their official installer, not compiling Qt myself. Though I think these kind of changes should be made to work as smooth as possible, probably not so many people compile Qt themselves.

aikawayataro commented 1 year ago

To my memory QtZlib has never been available in Desktop Qt Installer builds But it was a surprise to me that they broke build system compatibility for QtZlib in minor upgrade... It's basically a public API, i think