[PATCH 1/1] Update cmake_minimum_required to 3.5

18 views
Skip to first unread message

James Hilliard

unread,
May 14, 2025, 4:07:11 PMMay 14
to swup...@googlegroups.com, James Hilliard
This supports compilation with cmake-4.0.0.

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

Signed-off-by: James Hilliard <james.h...@gmail.com>
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 796d7bc..0a11730 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: LGPL-2.1-or-later

-cmake_minimum_required (VERSION 2.6)
+cmake_minimum_required (VERSION 3.5)
project (libubootenv C)

# The version number.
--
2.34.1

James Hilliard

unread,
May 14, 2025, 4:17:46 PMMay 14
to swup...@googlegroups.com, James Hilliard
This supports compilation with cmake-4.0.0.

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

Signed-off-by: James Hilliard <james.h...@gmail.com>
---
Changes v1 -> v2:
- also fix src/CMakeLists.txt
---
CMakeLists.txt | 2 +-
src/CMakeLists.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 796d7bc..0a11730 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: LGPL-2.1-or-later

-cmake_minimum_required (VERSION 2.6)
+cmake_minimum_required (VERSION 3.5)
project (libubootenv C)

# The version number.
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c56d0c7..3370232 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: 2019-2021 Stefano Babic <stefan...@swupdate.org>
#
# SPDX-License-Identifier: LGPL-2.1-or-later
-cmake_minimum_required (VERSION 2.6)
+cmake_minimum_required (VERSION 3.5)
# Sources and private headers
SET(libubootenv_SOURCES
uboot_env.c
--
2.34.1

Dominique MARTINET

unread,
Dec 4, 2025, 4:39:57 AMDec 4
to Stefano Babic, swup...@googlegroups.com, James Hilliard
Hi Stefano,

James Hilliard wrote on Wed, May 14, 2025 at 02:17:40PM -0600:
> This supports compilation with cmake-4.0.0.

Just a heads up I was bitten by this on alpine 3.23 -- the patch has
been merged for a while, perhaps it'd be time to cut a new libubootenv
release with what we have in tree?

(easily worked around for now by just applying this patch, no hurry from
me now it's done, just pointing out others might start to hit this soon)

--
Dominique

Stefano Babic

unread,
Dec 4, 2025, 4:44:12 AMDec 4
to Dominique MARTINET, swup...@googlegroups.com, James Hilliard
Yes, agree. I released yesterday SWUpdate, and I will go on to release
libubootenv and SWUgenerator.

Stefano

>

Reply all
Reply to author
Forward
0 new messages