libyaml-cpp: Add cmake 4.x compatibility
authorHannu Nyman <[email protected]>
Sun, 9 Nov 2025 07:03:05 +0000 (09:03 +0200)
committerHannu Nyman <[email protected]>
Sun, 9 Nov 2025 08:51:37 +0000 (10:51 +0200)
Backport an upstream patch to provide compatibility with cmake 4.x.
(Patch context adapted due to missing unrelated commits)

Signed-off-by: Hannu Nyman <[email protected]>
libs/libyaml-cpp/Makefile
libs/libyaml-cpp/patches/001-cmake4.patch [new file with mode: 0644]

index c72ef7c0955a910e98025d65f6223dd078b2cfcf..991e1451b0537c8c9b3bd248b78f5f1238faffd3 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libyaml-cpp
 PKG_VERSION:=0.8.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/jbeder/yaml-cpp
diff --git a/libs/libyaml-cpp/patches/001-cmake4.patch b/libs/libyaml-cpp/patches/001-cmake4.patch
new file mode 100644 (file)
index 0000000..d1c8397
--- /dev/null
@@ -0,0 +1,35 @@
+From c9371de7836d113c0b14bfa15ca70f00ebb3ac6f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Christoph=20Gr=C3=BCninger?= <[email protected]>
+Date: Mon, 24 Mar 2025 08:32:25 +0100
+Subject: [PATCH] [cmake] Require minimum CMake version 3.5
+
+Soon CMake 4.0 will be released. It requires that projects
+set a minimum required CMake version of 3.5. There is a
+workaround with an additional flag, but it would is better
+to increase the minimum required version.
+---
+ CMakeLists.txt      | 6 +++---
+ test/CMakeLists.txt | 1 -
+ 2 files changed, 3 insertions(+), 4 deletions(-)
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,5 +1,6 @@
+-# 3.5 is actually available almost everywhere, but this a good minimum
+-cmake_minimum_required(VERSION 3.4)
++# 3.5 is actually available almost everywhere.
++# 3.30 as the upper policy limit avoids CMake deprecation warnings.
++cmake_minimum_required(VERSION 3.5...3.30)
+ # enable MSVC_RUNTIME_LIBRARY target property
+ # see https://cmake.org/cmake/help/latest/policy/CMP0091.html
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -2,7 +2,6 @@ find_package(Threads REQUIRED)
+ set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
+ set(BUILD_MOCK ON CACHE BOOL "" FORCE)
+-set(CMAKE_POLICY_DEFAULT_CMP0048 NEW)
+ add_subdirectory(
+   "${CMAKE_CURRENT_SOURCE_DIR}/gtest-1.11.0"