[Buildroot] [PATCH 1/1] package/libfreeglut: override minimum CMake version for CMake 4 compatibility
Fiona Klute
fiona.klute at gmx.de
Mon Sep 1 17:34:38 UTC 2025
From: "Fiona Klute (WIWA)" <fiona.klute at gmx.de>
With CMake 4 building package/libfreeglut 3.4.0 fails, because
CMAKE_MINIMUM_REQUIRED is set to 3.0.0:
CMake Error at CMakeLists.txt:1 (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.
Overriding the minimum version allows the package to build.
Signed-off-by: Fiona Klute (WIWA) <fiona.klute at gmx.de>
---
Tested with CMake version 4.1.1. Generally freeglut upstream seems to
try for wide CMake version compatibility, see the changes to
CMakeLists.txt since 3.4.0:
* increase requirement to 3.1:
https://github.com/freeglut/freeglut/commit/f44eb886a513009b9b0c169ea274369c4dac9a04
* increase requirement to 3.11 (still significantly older than package/cmake):
https://github.com/freeglut/freeglut/commit/cd60d728b807c590b16884387ace17d334f364e2
* restore backwards-compatibility with 3.1:
https://github.com/freeglut/freeglut/commit/a9219b1cbf752bb1e963257ab04f3c70c0829c2e
* add 3.5 as supported minimum: https://github.com/freeglut/freeglut/commit/2294389397912c9a6505a88221abb7dca0a4fb79
Should make it safe to assume 3.5 is expected to work.
package/libfreeglut/libfreeglut.mk | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/package/libfreeglut/libfreeglut.mk b/package/libfreeglut/libfreeglut.mk
index 09309aeceb..7c27113331 100644
--- a/package/libfreeglut/libfreeglut.mk
+++ b/package/libfreeglut/libfreeglut.mk
@@ -17,7 +17,8 @@ LIBFREEGLUT_DEPENDENCIES = \
xlib_libXrandr \
xlib_libXxf86vm
-LIBFREEGLUT_CONF_OPTS = -DFREEGLUT_BUILD_DEMOS=OFF
+LIBFREEGLUT_CONF_OPTS = -DFREEGLUT_BUILD_DEMOS=OFF \
+ -DCMAKE_POLICY_VERSION_MINIMUM=3.5
# package depends on X.org which depends on !BR2_STATIC_LIBS
ifeq ($(BR2_SHARED_LIBS),y)
--
2.51.0
More information about the buildroot
mailing list