diff mbox series

[meta-openembedded,12/20] libfann: Add patch for CMake 4+ compatibility

Message ID 20250708195636.1678606-12-alperyasinak1@gmail.com
State New
Headers show
Series [meta-openembedded,01/20] cannelloni: Upgrade 1.1.0 -> 2.0.0 to allow CMake 4+ compatibility | expand

Commit Message

Alper Ak July 8, 2025, 7:56 p.m. UTC
Fix:

| CMake Error at CMakeLists.txt:41 (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!

| CMake Error at lib/googletest/CMakeLists.txt:48 (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       | 69 +++++++++++++++++++
 .../recipes-support/libfann/libfann_git.bb    |  3 +-
 2 files changed, 70 insertions(+), 2 deletions(-)
 create mode 100644 meta-oe/recipes-support/libfann/libfann/0001-allow-build-with-cmake-4.patch
diff mbox series

Patch

diff --git a/meta-oe/recipes-support/libfann/libfann/0001-allow-build-with-cmake-4.patch b/meta-oe/recipes-support/libfann/libfann/0001-allow-build-with-cmake-4.patch
new file mode 100644
index 0000000000..db1600f96c
--- /dev/null
+++ b/meta-oe/recipes-support/libfann/libfann/0001-allow-build-with-cmake-4.patch
@@ -0,0 +1,69 @@ 
+From a21c8455e2cfc5b19df1e42cd875c471d4e5cf63 Mon Sep 17 00:00:00 2001
+From: Alper Ak <alperyasinak1@gmail.com>
+Date: Tue, 8 Jul 2025 19:40:46 +0300
+Subject: [PATCH] cmake: Set minimum required version to 3.5 for CMake 4+
+ compatibility
+
+Fix:
+
+| CMake Error at CMakeLists.txt:41 (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!
+
+| CMake Error at lib/googletest/CMakeLists.txt:48 (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/libfann/fann/pull/152]
+
+Signed-off-by: Alper Ak <alperyasinak1@gmail.com>
+---
+ CMakeLists.txt                | 2 +-
+ lib/googletest/CMakeLists.txt | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 1b11d76..7e80be2 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -38,7 +38,7 @@ IF(BIICODE)
+ 	  ENDIF()
+ 	ENDIF()
+ ELSE()
+-cmake_minimum_required (VERSION 2.8)
++cmake_minimum_required (VERSION 3.5)
+ 
+ if (NOT DEFINED CMAKE_BUILD_TYPE)
+     set (CMAKE_BUILD_TYPE Release CACHE STRING "Build type")
+diff --git a/lib/googletest/CMakeLists.txt b/lib/googletest/CMakeLists.txt
+index 961672a..3762d18 100644
+--- a/lib/googletest/CMakeLists.txt
++++ b/lib/googletest/CMakeLists.txt
+@@ -45,7 +45,7 @@ endif()
+ # ${gtest_BINARY_DIR}.
+ # Language "C" is required for find_package(Threads).
+ project(gtest CXX C)
+-cmake_minimum_required(VERSION 2.6.2)
++cmake_minimum_required(VERSION 3.5)
+ 
+ if (COMMAND set_up_hermetic_build)
+   set_up_hermetic_build()
+-- 
+2.43.0
+
diff --git a/meta-oe/recipes-support/libfann/libfann_git.bb b/meta-oe/recipes-support/libfann/libfann_git.bb
index 2f68ea95a8..00b2af3829 100644
--- a/meta-oe/recipes-support/libfann/libfann_git.bb
+++ b/meta-oe/recipes-support/libfann/libfann_git.bb
@@ -10,9 +10,8 @@  inherit cmake
 
 SRCREV ?= "7ec1fc7e5bd734f1d3c89b095e630e83c86b9be1"
 SRC_URI = "git://github.com/libfann/fann.git;branch=master;protocol=https \
-          "
+        file://0001-allow-build-with-cmake-4.patch"
 
 PV = "2.2.0+git"
 
-
 EXTRA_OECMAKE = "-DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')}"