diff mbox series

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

Message ID 20250709173054.605430-16-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:8 (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 +++++++++++++++++++
 meta-oe/recipes-test/cpputest/cpputest_4.0.bb |  5 ++-
 2 files changed, 46 insertions(+), 2 deletions(-)
 create mode 100644 meta-oe/recipes-test/cpputest/cpputest/0001-allow-build-with-cmake-4.patch

Comments

Gyorgy Sarvari July 9, 2025, 6:21 p.m. UTC | #1
On 7/9/25 19:30, Alper Ak via lists.openembedded.org wrote:
> --- a/meta-oe/recipes-test/cpputest/cpputest_4.0.bb
> +++ b/meta-oe/recipes-test/cpputest/cpputest_4.0.bb
> @@ -5,9 +5,10 @@ SECTION = "devel"
>  LICENSE = "BSD-3-Clause"
>  LIC_FILES_CHKSUM = "file://COPYING;md5=ce5d5f1fe02bcd1343ced64a06fd4177"
>  
> -SRC_URI = "git://github.com/cpputest/cpputest.git;protocol=https;branch=master"
> -SRCREV = "67d2dfd41e13f09ff218aa08e2d35f1c32f032a1"
> +SRC_URI = "git://github.com/cpputest/cpputest.git;protocol=https;branch=master \
> +        file://0001-allow-build-with-cmake-4.patch"
>  
> +SRCREV = "67d2dfd41e13f09ff218aa08e2d35f1c32f032a1"
>  

Apparently this, 4.0 is the last tagged release of this application -
which is now over 5 years old. However it seems to be actively developed
ever since. Would it worth trying to switch to the latest git revision
(which has the cmake fix also), instead of patching? The developer
claims in https://github.com/cpputest/cpputest/issues/1651 that is the
revision survives their CI build, than it is considered "pretty stable",
just like the latest tag.

(If you are busy, that's fine, I can give it a test also later)
diff mbox series

Patch

diff --git a/meta-oe/recipes-test/cpputest/cpputest/0001-allow-build-with-cmake-4.patch b/meta-oe/recipes-test/cpputest/cpputest/0001-allow-build-with-cmake-4.patch
new file mode 100644
index 0000000000..cb12fe5f63
--- /dev/null
+++ b/meta-oe/recipes-test/cpputest/cpputest/0001-allow-build-with-cmake-4.patch
@@ -0,0 +1,43 @@ 
+From 2f264a05a1b0be02a8889427ff1e917f851097ea Mon Sep 17 00:00:00 2001
+From: Alper Ak <alperyasinak1@gmail.com>
+Date: Wed, 9 Jul 2025 18:50:25 +0300
+Subject: [PATCH] cmake: Set minimum required version to 3.5 for CMake 4+
+ compatibility
+
+Fix:
+
+| CMake Error at CMakeLists.txt:8 (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: Backport [https://github.com/cpputest/cpputest/commit/fbb8526750aa370e642da7c21a98d6efdf7a3f37]
+
+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 88e0cfb5..1fa3f27e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -5,7 +5,7 @@ set(CppUTest_version_minor 0)
+ 
+ # 2.6.3 is needed for ctest support
+ # 3.1 is needed for target_sources
+-cmake_minimum_required(VERSION 3.1)
++cmake_minimum_required(VERSION 3.5)
+ 
+ ###############
+ # Conan support
+-- 
+2.43.0
+
diff --git a/meta-oe/recipes-test/cpputest/cpputest_4.0.bb b/meta-oe/recipes-test/cpputest/cpputest_4.0.bb
index 5710585b6c..bdc954c1e9 100644
--- a/meta-oe/recipes-test/cpputest/cpputest_4.0.bb
+++ b/meta-oe/recipes-test/cpputest/cpputest_4.0.bb
@@ -5,9 +5,10 @@  SECTION = "devel"
 LICENSE = "BSD-3-Clause"
 LIC_FILES_CHKSUM = "file://COPYING;md5=ce5d5f1fe02bcd1343ced64a06fd4177"
 
-SRC_URI = "git://github.com/cpputest/cpputest.git;protocol=https;branch=master"
-SRCREV = "67d2dfd41e13f09ff218aa08e2d35f1c32f032a1"
+SRC_URI = "git://github.com/cpputest/cpputest.git;protocol=https;branch=master \
+        file://0001-allow-build-with-cmake-4.patch"
 
+SRCREV = "67d2dfd41e13f09ff218aa08e2d35f1c32f032a1"
 
 inherit cmake