From 1ea815a359013a92542f8b47dd1cdeed41bf8fdc Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Tue, 12 May 2026 17:05:05 +0200 Subject: [PATCH] minizip: CMake 4+ compatibility Set `CMAKE_POLICY_VERSION_MINIMUM=3.5` to make the project work with CMake 4+. This fixes the following error: ``` CMake Error at CMakeLists.txt (cmake_minimum_required): Compatibility with CMake < 3.5 has been removed from CMake. Update the VERSION argument value. Or, use the ... syntax to tell CMake that the project requires at least but has been updated to work with policies introduced by or earlier. Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway. ``` --- cmake/projects/minizip/hunter.cmake | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cmake/projects/minizip/hunter.cmake b/cmake/projects/minizip/hunter.cmake index 478468a52b..755e790cb7 100644 --- a/cmake/projects/minizip/hunter.cmake +++ b/cmake/projects/minizip/hunter.cmake @@ -53,7 +53,16 @@ hunter_add_version( 65728dbf7573d3f1826d04a3b686d80eb099d7b8 ) -hunter_cmake_args(minizip CMAKE_ARGS USE_AES=FALSE) +if(HUNTER_minizip_VERSION VERSION_LESS 1.0.2) + # CMake 4.0+ compatibility with older minizip packages + set(_hunter_minizip_cmake_compatibility_flag "CMAKE_POLICY_VERSION_MINIMUM=3.5") +else() + set(_hunter_minizip_cmake_compatibility_flag "") +endif() +hunter_cmake_args(minizip CMAKE_ARGS + USE_AES=FALSE + ${_hunter_minizip_cmake_compatibility_flag} +) hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(minizip)