From 304b9fd3ffe7e1aba06ff899529db16c82ad2f5a Mon Sep 17 00:00:00 2001 From: Thomas Perale Date: Mon, 26 Jan 2026 14:38:48 +0100 Subject: [PATCH] support/dependencies/check-host-cmake.mk: set host-cmake max version Since the introduction of CMake 4 in several distributions such as Alpine [1] or Arch [2], build errors started occurring for cmake packages that included calls to cmake_minimum_required() or cmake_policy() with a version older than 3.5 (see [3]). This patch enforce building host-cmake when the host system provides CMake 4 or newer. This patch is only meant for LTS maintenance branches in which the host-cmake was kept to a version less than 4.x. This is to avoid too many unnecessary package updates and patches. If a package fail to build on the master branch because of this error it should be fixed instead. [1] https://gitlab.alpinelinux.org/alpine/aports/-/commit/21fe3cb10d65862648a7a65cc258899bfcae9b11 [2] https://gitlab.archlinux.org/archlinux/packaging/packages/cmake/-/commit/b634e8ded6d2d887450586f14f404f72518b97b9 [3] https://cmake.org/cmake/help/latest/release/4.0.html#deprecated-and-removed-features Signed-off-by: Thomas Perale --- support/dependencies/check-host-cmake.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/support/dependencies/check-host-cmake.sh b/support/dependencies/check-host-cmake.sh index fadeae9f6b..c7aa16f48d 100755 --- a/support/dependencies/check-host-cmake.sh +++ b/support/dependencies/check-host-cmake.sh @@ -6,6 +6,9 @@ major_min="${1%.*}" minor_min="${1#*.}" +major_max="4" +minor_max="0" + shift for candidate; do @@ -32,6 +35,12 @@ for candidate; do major="${version%.*}" minor="${version#*.}" + if [ ${major} -gt ${major_max} ]; then + continue + elif [ ${major} -eq ${major_max} -a ${minor} -ge ${minor_max} ]; then + continue + fi + if [ ${major} -gt ${major_min} ]; then echo "${cmake}" exit