libfann: Add patch 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!

Signed-off-by: Alper Ak <alperyasinak1@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Alper Ak 2025-07-08 22:56:28 +03:00 committed by Khem Raj
parent e07430eb44
commit 081cc6529b
No known key found for this signature in database
GPG Key ID: BB053355919D3314
2 changed files with 70 additions and 2 deletions

View File

@ -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

View File

@ -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', '')}"