diff mbox series

[meta-openembedded,5/5] linux-serial-test: Add patch for CMake 4+ compatibility

Message ID 20250710173827.43239-5-alperyasinak1@gmail.com
State Under Review
Headers show
Series [meta-openembedded,1/5] physfs: Add patch for CMake 4+ compatibility | expand

Commit Message

Alper Ak July 10, 2025, 5:38 p.m. UTC
Fix:

| CMake Error at CMakeLists.txt:4 (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.
|
|
| -- Configuring incomplete, errors occurred!

Signed-off-by: Alper Ak <alperyasinak1@gmail.com>
---
 .../0001-allow-build-with-cmake-4.patch       | 43 +++++++++++++++++++
 .../linux-serial-test_git.bb                  |  3 +-
 2 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-test/linux-serial-test/linux-serial-test/0001-allow-build-with-cmake-4.patch
diff mbox series

Patch

diff --git a/meta-oe/recipes-test/linux-serial-test/linux-serial-test/0001-allow-build-with-cmake-4.patch b/meta-oe/recipes-test/linux-serial-test/linux-serial-test/0001-allow-build-with-cmake-4.patch
new file mode 100644
index 0000000000..0b67ad03b1
--- /dev/null
+++ b/meta-oe/recipes-test/linux-serial-test/linux-serial-test/0001-allow-build-with-cmake-4.patch
@@ -0,0 +1,43 @@ 
+From 83ec3d72913cbdee0c0f27fe74f77bf2ef1d1901 Mon Sep 17 00:00:00 2001
+From: Alper Ak <alperyasinak1@gmail.com>
+Date: Thu, 10 Jul 2025 14:11:22 +0300
+Subject: [PATCH] cmake: Set minimum required version to 3.5 for CMake 4+
+ compatibility
+
+Fix:
+
+| CMake Error at CMakeLists.txt:4 (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.
+|
+|
+| -- Configuring incomplete, errors occurred!
+
+Upstream-Status: Submitted [https://github.com/cbrake/linux-serial-test/pull/60]
+
+Signed-off-by: Alper Ak <alperyasinak1@gmail.com>
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 10e3968..4ce6ef1 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,7 +1,7 @@
+ # SPDX-License-Identifier: MIT
+ 
+ project(linux-serial-test C)
+-cmake_minimum_required(VERSION 2.6)
++cmake_minimum_required(VERSION 3.5)
+ add_executable(linux-serial-test linux-serial-test.c)
+ target_link_libraries(linux-serial-test rt)
+ install(TARGETS linux-serial-test DESTINATION bin)
+-- 
+2.43.0
+
diff --git a/meta-oe/recipes-test/linux-serial-test/linux-serial-test_git.bb b/meta-oe/recipes-test/linux-serial-test/linux-serial-test_git.bb
index c617cf09a3..a451db2a76 100644
--- a/meta-oe/recipes-test/linux-serial-test/linux-serial-test_git.bb
+++ b/meta-oe/recipes-test/linux-serial-test/linux-serial-test_git.bb
@@ -3,7 +3,8 @@  HOMEPAGE = "https://github.com/cbrake/linux-serial-test"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSES/MIT;md5=544799d0b492f119fa04641d1b8868ed"
 
-SRC_URI = "git://github.com/cbrake/linux-serial-test.git;protocol=https;branch=master"
+SRC_URI = "git://github.com/cbrake/linux-serial-test.git;protocol=https;branch=master \
+        file://0001-allow-build-with-cmake-4.patch"
 
 PV = "0+git"
 SRCREV = "2ee61484167eab846f7b7c565284d7c350d738d3"