Skip to content

Commit 30dcb4f

Browse files
authored
minizip: CMake 4+ compatibility (#853)
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 <min> value. Or, use the <min>...<max> syntax to tell CMake that the project requires at least <min> but has been updated to work with policies introduced by <max> or earlier. Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway. ```
1 parent 0e9e25d commit 30dcb4f

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

cmake/projects/minizip/hunter.cmake

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,16 @@ hunter_add_version(
5353
65728dbf7573d3f1826d04a3b686d80eb099d7b8
5454
)
5555

56-
hunter_cmake_args(minizip CMAKE_ARGS USE_AES=FALSE)
56+
if(HUNTER_minizip_VERSION VERSION_LESS 1.0.2)
57+
# CMake 4.0+ compatibility with older minizip packages
58+
set(_hunter_minizip_cmake_compatibility_flag "CMAKE_POLICY_VERSION_MINIMUM=3.5")
59+
else()
60+
set(_hunter_minizip_cmake_compatibility_flag "")
61+
endif()
62+
hunter_cmake_args(minizip CMAKE_ARGS
63+
USE_AES=FALSE
64+
${_hunter_minizip_cmake_compatibility_flag}
65+
)
5766

5867
hunter_pick_scheme(DEFAULT url_sha1_cmake)
5968
hunter_cacheable(minizip)

0 commit comments

Comments
 (0)