From 081cc6529bc23a18aab3f39756e7d429f68de3ed Mon Sep 17 00:00:00 2001 From: Alper Ak Date: Tue, 8 Jul 2025 22:56:28 +0300 Subject: 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 value. Or, use the ... syntax | to tell CMake that the project requires at least but has been updated | to work with policies introduced by 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 value. Or, use the ... syntax | to tell CMake that the project requires at least but has been updated | to work with policies introduced by or earlier. | | Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway. | | | -- Configuring incomplete, errors occurred! Signed-off-by: Alper Ak Signed-off-by: Khem Raj --- .../libfann/0001-allow-build-with-cmake-4.patch | 69 ++++++++++++++++++++++ meta-oe/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 --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 +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 value. Or, use the ... syntax +| to tell CMake that the project requires at least but has been updated +| to work with policies introduced by 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 value. Or, use the ... syntax +| to tell CMake that the project requires at least but has been updated +| to work with policies introduced by 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 +--- + 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', '')}" -- cgit v1.2.3-54-g00ecf