diff mbox series

[meta-openembedded,15/20] dlt-daemon: Add patch for CMake 4+ compatibility

Message ID 20250709173054.605430-15-alperyasinak1@gmail.com
State Under Review
Headers show
Series [meta-openembedded,01/20] librdkafka: Upgrade 1.8.2 -> 2.11.0 to allow CMake 4+ compatibility | expand

Commit Message

Alper Ak July 9, 2025, 5:30 p.m. UTC
Fix:

| CMake Error at CMakeLists.txt:17 (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>
---
 .../0003-allow-build-with-cmake-4.patch       | 99 +++++++++++++++++++
 .../dlt-daemon/dlt-daemon_2.18.10.bb          |  1 +
 2 files changed, 100 insertions(+)
 create mode 100644 meta-oe/recipes-extended/dlt-daemon/dlt-daemon/0003-allow-build-with-cmake-4.patch
diff mbox series

Patch

diff --git a/meta-oe/recipes-extended/dlt-daemon/dlt-daemon/0003-allow-build-with-cmake-4.patch b/meta-oe/recipes-extended/dlt-daemon/dlt-daemon/0003-allow-build-with-cmake-4.patch
new file mode 100644
index 0000000000..ac5fec5684
--- /dev/null
+++ b/meta-oe/recipes-extended/dlt-daemon/dlt-daemon/0003-allow-build-with-cmake-4.patch
@@ -0,0 +1,99 @@ 
+From ae23f2cccc169874d89903cad24bf36e19bef659 Mon Sep 17 00:00:00 2001
+From: Alper Ak <alperyasinak1@gmail.com>
+Date: Wed, 9 Jul 2025 18:18:33 +0300
+Subject: [PATCH] cmake: Set minimum required version to 3.5 for CMake 4+
+ compatibility
+
+Fix:
+
+| CMake Error at CMakeLists.txt:17 (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/COVESA/dlt-daemon/pull/755]
+
+Signed-off-by: Alper Ak <alperyasinak1@gmail.com>
+---
+ CMakeLists.txt                   | 2 +-
+ examples/example1/CMakeLists.txt | 2 +-
+ examples/example2/CMakeLists.txt | 2 +-
+ examples/example3/CMakeLists.txt | 2 +-
+ examples/example4/CMakeLists.txt | 2 +-
+ 5 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 94185b8..2a0f619 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -14,7 +14,7 @@
+ #######
+ 
+ # Set minimum Cmake version and setup policy behavior
+-cmake_minimum_required(VERSION 3.3)
++cmake_minimum_required(VERSION 3.5)
+ 
+ if(${CMAKE_VERSION} VERSION_GREATER "3.20" OR ${CMAKE_VERSION} VERSION_EQUAL "3.20")
+     cmake_policy(SET CMP0115 OLD)
+diff --git a/examples/example1/CMakeLists.txt b/examples/example1/CMakeLists.txt
+index 60644a1..44cd053 100644
+--- a/examples/example1/CMakeLists.txt
++++ b/examples/example1/CMakeLists.txt
+@@ -17,7 +17,7 @@
+ # DLT example implementation
+ #
+ 
+-cmake_minimum_required( VERSION 2.6 )
++cmake_minimum_required( VERSION 3.5 )
+ project( automotive-dlt-example1 )
+ 
+ #
+diff --git a/examples/example2/CMakeLists.txt b/examples/example2/CMakeLists.txt
+index 66a4f24..a8efbcf 100644
+--- a/examples/example2/CMakeLists.txt
++++ b/examples/example2/CMakeLists.txt
+@@ -17,7 +17,7 @@
+ # DLT example implementation
+ #
+ 
+-cmake_minimum_required( VERSION 2.6 )
++cmake_minimum_required( VERSION 3.5 )
+ project( automotive-dlt-example2 )
+ 
+ #
+diff --git a/examples/example3/CMakeLists.txt b/examples/example3/CMakeLists.txt
+index 45b7467..4d4958d 100644
+--- a/examples/example3/CMakeLists.txt
++++ b/examples/example3/CMakeLists.txt
+@@ -17,7 +17,7 @@
+ # DLT example implementation
+ #
+ 
+-cmake_minimum_required( VERSION 2.6 )
++cmake_minimum_required( VERSION 3.5 )
+ project( automotive-dlt-example3 )
+ 
+ #
+diff --git a/examples/example4/CMakeLists.txt b/examples/example4/CMakeLists.txt
+index 53a4fad..161c333 100644
+--- a/examples/example4/CMakeLists.txt
++++ b/examples/example4/CMakeLists.txt
+@@ -17,7 +17,7 @@
+ # DLT example implementation
+ #
+ 
+-cmake_minimum_required( VERSION 2.6 )
++cmake_minimum_required( VERSION 3.5 )
+ project( automotive-dlt-example4 )
+ 
+ #
+-- 
+2.43.0
+
diff --git a/meta-oe/recipes-extended/dlt-daemon/dlt-daemon_2.18.10.bb b/meta-oe/recipes-extended/dlt-daemon/dlt-daemon_2.18.10.bb
index 8b48d20aac..82edde6c9d 100644
--- a/meta-oe/recipes-extended/dlt-daemon/dlt-daemon_2.18.10.bb
+++ b/meta-oe/recipes-extended/dlt-daemon/dlt-daemon_2.18.10.bb
@@ -20,6 +20,7 @@  SRC_URI = "git://github.com/COVESA/${BPN}.git;protocol=https;branch=master \
            file://544.patch \
            file://567.patch \
            file://0001-CMakeLists-txt-make-DLT_WatchdogSec-can-be-set-by-user.patch \
+           file://0003-allow-build-with-cmake-4.patch \
            "
 SRCREV = "0f2d4cfffada6f8448a2cb27995b38eb4271044f"