Skip to content

Commit faadd3c

Browse files
committed
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 <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 d448bc1 commit faadd3c

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

cmake/projects/jasper/hunter.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,21 @@ hunter_add_version(
7575
ef82c0800db4070de0972dde4fe1b6032f2012f2
7676
)
7777

78+
if(HUNTER_jasper_VERSION VERSION_LESS 2.0.33)
79+
# CMake 4.0+ compatibility with older jasper packages
80+
set(_hunter_jasper_cmake_compatibility_flag "CMAKE_POLICY_VERSION_MINIMUM=3.5")
81+
else()
82+
set(_hunter_jasper_cmake_compatibility_flag "")
83+
endif()
84+
7885
hunter_cmake_args(
7986
jasper
8087
CMAKE_ARGS
8188
JAS_ENABLE_AUTOMATIC_DEPENDENCIES=OFF
8289
JAS_ENABLE_OPENGL=OFF
8390
JAS_ENABLE_PROGRAMS=OFF
8491
JAS_ENABLE_DOC=OFF
92+
${_hunter_jasper_cmake_compatibility_flag}
8593
)
8694

8795
hunter_pick_scheme(DEFAULT url_sha1_cmake)

0 commit comments

Comments
 (0)