From faadd3ce5aa0798e408d9722c267e6df65d0ef2e Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Tue, 12 May 2026 16:52:24 +0200 Subject: [PATCH] jasper: 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/jasper/hunter.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmake/projects/jasper/hunter.cmake b/cmake/projects/jasper/hunter.cmake index a67d86015b..0979dec0a4 100644 --- a/cmake/projects/jasper/hunter.cmake +++ b/cmake/projects/jasper/hunter.cmake @@ -75,6 +75,13 @@ hunter_add_version( ef82c0800db4070de0972dde4fe1b6032f2012f2 ) +if(HUNTER_jasper_VERSION VERSION_LESS 2.0.33) + # CMake 4.0+ compatibility with older jasper packages + set(_hunter_jasper_cmake_compatibility_flag "CMAKE_POLICY_VERSION_MINIMUM=3.5") +else() + set(_hunter_jasper_cmake_compatibility_flag "") +endif() + hunter_cmake_args( jasper CMAKE_ARGS @@ -82,6 +89,7 @@ hunter_cmake_args( JAS_ENABLE_OPENGL=OFF JAS_ENABLE_PROGRAMS=OFF JAS_ENABLE_DOC=OFF + ${_hunter_jasper_cmake_compatibility_flag} ) hunter_pick_scheme(DEFAULT url_sha1_cmake)