Merge pull request #9964 from heitbaum/cmake1

CMake patches and fix for packages (group 2 ) to build with cmake 4.0.0
This commit is contained in:
CvH 2025-04-14 17:16:49 +02:00 committed by GitHub
commit eb71165292
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
21 changed files with 3196 additions and 0 deletions

View File

@ -0,0 +1,33 @@
From 3fa740494edfd11fa84bf714a6ffa14c910b6385 Mon Sep 17 00:00:00 2001
From: Rudi Heitbaum <rudi@heitbaum.com>
Date: Fri, 28 Mar 2025 19:10:02 +1100
Subject: [PATCH] chore: allow CMake though to 3.10
This is allows the build with cmake-4.0.0 without deprecation warnings.
use min...max syntax to allow build with newer cmake.
ref: https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html
Fixes:
CMake Error at CMakeLists.txt:1 (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.
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ca0209b..16d693d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 2.8.0)
+cmake_minimum_required (VERSION 2.8.12...3.10)
project (tini C)
# Config

View File

@ -0,0 +1,95 @@
From 6a130ba36867c23eb3dcbff32a1abb7386eb2eab Mon Sep 17 00:00:00 2001
From: Ihor Dutchak <ihor.youw@gmail.com>
Date: Tue, 5 Mar 2024 11:16:18 +0200
Subject: [PATCH] Avoid CMake backward compatibility warning
Avoid a message:
```
Compatibility with CMake < 3.5 will be removed from a future version of CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
```
---
BUILD.cmake.md | 2 +-
CMakeLists.txt | 2 +-
hidtest/CMakeLists.txt | 2 +-
libusb/CMakeLists.txt | 2 +-
linux/CMakeLists.txt | 2 +-
mac/CMakeLists.txt | 2 +-
subprojects/hidapi_build_cmake/CMakeLists.txt | 2 +-
8 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/BUILD.cmake.md b/BUILD.cmake.md
index 5555fd2ea..573f910de 100644
--- a/BUILD.cmake.md
+++ b/BUILD.cmake.md
@@ -159,7 +159,7 @@ endif()
HIDAPI can be easily used as a subdirectory of a larger CMake project:
```cmake
# root CMakeLists.txt
-cmake_minimum_required(VERSION 3.4.3 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.4.3...3.25 FATAL_ERROR)
add_subdirectory(hidapi)
add_subdirectory(my_application)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b4c99be51..d7086813c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.1.3 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.1.3...3.25 FATAL_ERROR)
if(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
add_subdirectory(src)
diff --git a/hidtest/CMakeLists.txt b/hidtest/CMakeLists.txt
index 701a4fb91..19c50e1fb 100644
--- a/hidtest/CMakeLists.txt
+++ b/hidtest/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.1.3 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.1.3...3.25 FATAL_ERROR)
project(hidtest C)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
diff --git a/libusb/CMakeLists.txt b/libusb/CMakeLists.txt
index 617cd551a..4c458c569 100644
--- a/libusb/CMakeLists.txt
+++ b/libusb/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.6.3 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.6.3...3.25 FATAL_ERROR)
list(APPEND HIDAPI_PUBLIC_HEADERS "hidapi_libusb.h")
diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt
index 0970ac3f1..9c627087f 100644
--- a/linux/CMakeLists.txt
+++ b/linux/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.6.3 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.6.3...3.25 FATAL_ERROR)
add_library(hidapi_hidraw
${HIDAPI_PUBLIC_HEADERS}
diff --git a/mac/CMakeLists.txt b/mac/CMakeLists.txt
index ccb0b91d4..0a1c1d95b 100644
--- a/mac/CMakeLists.txt
+++ b/mac/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.4.3 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.4.3...3.25 FATAL_ERROR)
list(APPEND HIDAPI_PUBLIC_HEADERS "hidapi_darwin.h")
diff --git a/subprojects/hidapi_build_cmake/CMakeLists.txt b/subprojects/hidapi_build_cmake/CMakeLists.txt
index 80aed67d5..4586ce6a6 100644
--- a/subprojects/hidapi_build_cmake/CMakeLists.txt
+++ b/subprojects/hidapi_build_cmake/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.1.3 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.1.3...3.25 FATAL_ERROR)
project(hidapi LANGUAGES C)
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/root")

View File

@ -0,0 +1,24 @@
From b0d4d3d42805ab386522eed65d515826c1a27f15 Mon Sep 17 00:00:00 2001
From: heitbaum <heitbaum@noreply.codeberg.org>
Date: Fri, 28 Mar 2025 11:22:50 +0000
Subject: [PATCH] Allow build with cmake 4.0.0
use min...max syntax to allow build with newer cmake.
ref: https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d181300..a1d6fdc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.1.0)
+cmake_minimum_required(VERSION 3.1.0...3.10)
project(id3tag VERSION 0.16.3)
option(BUILD_SHARED_LIBS "Build dynamic library" ON)
--
2.45.2

View File

@ -0,0 +1,25 @@
From be22e5273a8c935c141b4c75212f1f8b6b3fbd39 Mon Sep 17 00:00:00 2001
From: Rudi Heitbaum <rudi@heitbaum.com>
Date: Fri, 28 Mar 2025 23:01:09 +1100
Subject: [PATCH] Allow build with cmake 4.0.0
use min...max syntax to allow build with newer cmake.
ref: https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e9baa87..6324684 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,7 +9,7 @@
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE file for details.
-cmake_minimum_required(VERSION 3.0.0)
+cmake_minimum_required(VERSION 3.0.0...3.10)
project(aixlog VERSION 1.5.0 LANGUAGES CXX)
set(PROJECT_DESCRIPTION "Header-only C++ logging library")

View File

@ -0,0 +1,25 @@
From f1ce4d40c73674773b49cf37c0a7eb2f80327a08 Mon Sep 17 00:00:00 2001
From: Rudi Heitbaum <rudi@heitbaum.com>
Date: Fri, 28 Mar 2025 12:31:12 +0000
Subject: [PATCH] allow compile with cmake 4.0.0
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 57c35232..eda93224 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,7 +22,7 @@
# IN THE SOFTWARE.
#
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.5)
include(CheckFunctionExists)
include(CheckSymbolExists)
include(CheckIncludeFile)
--
2.43.0

View File

@ -0,0 +1,11 @@
--- a/CMakeLists.txt 2025-03-29 05:49:04.740039035 +0000
+++ b/CMakeLists.txt 2025-03-29 08:56:21.238777085 +0000
@@ -2,7 +2,7 @@
#----------------------- minimum version of cmake to use ------------
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 2.8.12...3.10)
cmake_policy(SET CMP0003 NEW)
if(POLICY CMP0042)

View File

@ -0,0 +1,49 @@
From cb3c78f43394930f890bfb6fb34834d8d1a58496 Mon Sep 17 00:00:00 2001
From: Pierre Ossman <ossman@cendio.se>
Date: Fri, 5 Nov 2021 12:53:11 +0100
Subject: [PATCH 3/3] Raise CMake requirement to 3.10
It's difficult to support both old and new versions, so raise the
requirement to the oldest that is commonly used, which is CMake 3.10.2
on Ubuntu 18.04.
---
CMakeLists.txt | 22 +-------------------
5 files changed, 6 insertions(+), 33 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3f54fbfe9b..50247c7dac 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,10 +2,7 @@
# Setup
#
-cmake_minimum_required(VERSION 2.8.11)
-if(POLICY CMP0022)
- cmake_policy(SET CMP0022 OLD)
-endif()
+cmake_minimum_required(VERSION 3.10.0)
# Internal cmake modules
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
@@ -105,20 +99,6 @@ else()
message(STATUS "32-bit build")
endif()
-# Versions of CMake before 2.8.7 do not properly support resource compilation
-# with MinGW. Boo!
-if(MINGW AND "${CMAKE_VERSION}" VERSION_LESS "2.8.7")
- if(NOT DEFINED RC)
- set(CMAKE_RC_COMPILER_INIT windres)
- else()
- set(CMAKE_RC_COMPILER_INIT ${RC})
- endif()
- enable_language(RC)
- message(STATUS "Resource compiler: ${CMAKE_RC_COMPILER}")
- set(CMAKE_RC_COMPILE_OBJECT
- "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -o <OBJECT> --output-format=coff <SOURCE>")
-endif()
-
# MinGW64 has header support but no library support for IActiveDesktop, so we
# need to check for both the header and library and use our own implementation
# in common/os if either doesn't exist.

View File

@ -0,0 +1,22 @@
From 7c6911cd9dc4459807c345f693bcbeafb4307059 Mon Sep 17 00:00:00 2001
From: Rudi Heitbaum <rudi@heitbaum.com>
Date: Tue, 15 Apr 2025 00:01:39 +1000
Subject: [PATCH] Allow build with CMake 4.0.0
use min...max syntax to allow build with newer cmake.
ref: https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7739887..ecbf6da 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.0...3.10)
project(libldac
LANGUAGES C
VERSION 2.0.2.3)

View File

@ -0,0 +1,8 @@
--- a/CMakeLists.txt 2021-05-10 17:40:30.000000000 +0000
+++ b/CMakeLists.txt 2025-03-28 00:15:53.012191534 +0000
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.0...3.10)
project(libogg)
# Required modules

View File

@ -0,0 +1,10 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e3d91c0ea..c41bbce03 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.1..3.18)
+cmake_minimum_required (VERSION 3.1...3.18)
# MSVC runtime library flags are selected by an abstraction, CMake >= 3.15
# This policy still need to be set even with cmake_minimum_required() command above.

View File

@ -0,0 +1,11 @@
--- a/CMakeLists.txt 2017-03-01 19:54:14.000000000 +0000
+++ b/CMakeLists.txt 2025-03-27 23:36:08.260236301 +0000
@@ -8,7 +8,7 @@
# All Rights Reserved.
#
-cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.0...3.10 FATAL_ERROR)
#
# simple usage example (Unix):

View File

@ -0,0 +1,21 @@
From 42864e12b0d7af01b1cf989d6da9e9a4477775a1 Mon Sep 17 00:00:00 2001
From: Rudi Heitbaum <rudi@heitbaum.com>
Date: Fri, 28 Mar 2025 23:14:48 +1100
Subject: [PATCH] Allow build with cmake 4.0.0
Update the min version to match parent CMakeLists.txt 3.9...3.12
---
apps/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt
index f7c9dec633..ef2271d131 100644
--- a/apps/CMakeLists.txt
+++ b/apps/CMakeLists.txt
@@ -1,5 +1,5 @@
-cmake_minimum_required(VERSION 2.8) # see ../CMakeLists.txt for why 2.8
+cmake_minimum_required(VERSION 3.9...3.12)
if(POLICY CMP0075)
cmake_policy(SET CMP0075 NEW)

View File

@ -0,0 +1,59 @@
From bd2de4836b6b48d64da0cf010727209ad259a4f4 Mon Sep 17 00:00:00 2001
From: Azat Khuzhin <azat@libevent.org>
Date: Wed, 26 Jun 2019 00:59:41 +0300
Subject: [PATCH] Require cmake >= 3.1.2 (for correct openssl 1.0.2 detection)
@ygj6 reported:
"My platform is MacOS 10.13.5, This problem only happens on Mac.
As written in the file CMakeLists.txt, the minimum required version of cmake is 3.1:
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
So I built this project with cmake-3.1.0, but I got the following errors:
CMake Error at /usr/local/cmake-3.1.0/share/cmake/Modules/FindOpenSSL.cmake:293 (list):
list GET given empty list
Call Stack (most recent call first):
CMakeLists.txt:824 (find_package)
CMake Error at /usr/local/cmake-3.1.0/share/cmake/Modules/FindOpenSSL.cmake:294 (list):
list GET given empty list
Call Stack (most recent call first):
CMakeLists.txt:824 (find_package)
CMake Error at /usr/local/cmake-3.1.0/share/cmake/Modules/FindOpenSSL.cmake:296 (list):
list GET given empty list
Call Stack (most recent call first):
CMakeLists.txt:824 (find_package)
CMake Error at /usr/local/cmake-3.1.0/share/cmake/Modules/FindOpenSSL.cmake:298 (list):
list GET given empty list
Call Stack (most recent call first):
CMakeLists.txt:824 (find_package)
I googled this error and got this answer:
https://bugs.archlinux.org/task/43688
It is a bug in FindOpenSSL.cmake on cmake-3.1.0 and fixed on cmake-3.1.2 .
Of course, It was successful when rebuilding with cmake-3.1.2 .
So I suggest setting the minimum version required for cmake to 3.1.2 or higher.
"
Closes: #845
Refs: https://github.com/Kitware/CMake/commit/de4ccee75a89519f95fcbcca75abc46577bfefea
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e2089f832a..5aca8a9247 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,7 +19,7 @@
# start libevent.sln
#
-cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.1.2 FATAL_ERROR)
if (POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)

View File

@ -0,0 +1,58 @@
From acfac7ae4a3edbbb7ce4ceee7208b4245a6e203e Mon Sep 17 00:00:00 2001
From: Ingo Bauersachs <ingo.bauersachs@xovis.com>
Date: Thu, 1 Dec 2022 18:39:52 +0100
Subject: [PATCH] Make dependency paths relocatable
The generated configurations for both CMake and pkg-config included
absolute paths to dependencies (OpenSSL, MbedTLS). This is contrary
to the general CMake advise to create relocatable packages [1].
Additionally, when building both mbedtls and libevent via CMake's
FetchContent in the same project, loading the project would fail with
INTERFACE_INCLUDE_DIRECTORIES property contains path:
"/home/user/project/cmake-build/_deps/mbedtls-build/include"
which is prefixed in the source directory.
The required changes include:
- Adding the outer includes only to the BUILD_INTERFACE solves the
makes the CMake paths relocatable and thus solves the FetchContent
problem.
- Updates to libevent_*.pc.in fixes the relocatable issues for
pkg-config and properly declares currently missing dependencies.
- Using components for linking to OpenSSL (requiring CMake 3.4)
and MbedTLS. The new MbedTLS target names now match the component
names of the MbedTLS' CMake project.
- Use the Threads CMake library reference instead of a direct
reference to support both built-in pthread and -lpthread.
v2 (azat): get back CMAKE_REQUIRED_LIBRARIES
[1] https://cmake.org/cmake/help/v3.25/manual/cmake-packages.7.html#creating-relocatable-packages
---
CMakeLists.txt | 28 +++++++++++-----------------
cmake/AddEventLibrary.cmake | 31 ++++++++++---------------------
cmake/FindMbedTLS.cmake | 20 +++++++++++---------
cmake/LibeventConfig.cmake.in | 21 ++++++++++++++++++---
libevent_core.pc.in | 5 +----
libevent_extra.pc.in | 6 ++----
libevent_mbedtls.pc.in | 8 +++-----
libevent_openssl.pc.in | 9 ++++-----
libevent_pthreads.pc.in | 8 +++-----
test-export/CMakeLists.txt | 3 ++-
test-export/test-export.py | 18 ++++++++++++++++--
11 files changed, 81 insertions(+), 76 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7199ab820d..c0c1c2fa97 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,7 +19,7 @@
# start libevent.sln
#
-cmake_minimum_required(VERSION 3.1.2 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.4 FATAL_ERROR)
if (POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)

View File

@ -0,0 +1,23 @@
From a9426941555ec52b25c3641ebb8af72d7d91ebf8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C5=93ur?= <coeur@gmx.fr>
Date: Sun, 28 Apr 2024 13:16:54 +0800
Subject: [PATCH] Fix CMake Deprecation Warning
---
CMakeLists.txt | 2 +-
test-export/CMakeLists.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2ba64403ca..1869fccd2d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,7 +19,7 @@
# start libevent.sln
#
-cmake_minimum_required(VERSION 3.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
if (POLICY CMP0042)
cmake_policy(SET CMP0042 NEW) # MACOSX_RPATH is enabled by default.

View File

@ -0,0 +1,27 @@
From 2d7a3b9b6a7c7ef0d651d866b4ab11fb1ea24664 Mon Sep 17 00:00:00 2001
From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
Date: Sat, 16 Nov 2024 21:26:55 +0000
Subject: [PATCH] cmake: Update minimum required version
Compatibility with versions of CMake older than 3.10 is now deprecated
and will be removed from a future version.
See: https://cmake.org/cmake/help/v3.31/release/3.31.html
---
CMakeLists.txt | 2 +-
test-export/CMakeLists.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 25578930b4..04e6933bee 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,7 +19,7 @@
# start libevent.sln
#
-cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
if (POLICY CMP0042)
cmake_policy(SET CMP0042 NEW) # MACOSX_RPATH is enabled by default.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,26 @@
From ebd87cb468fb4cb060b37e579718c4a4125416c1 Mon Sep 17 00:00:00 2001
From: Christian Fersch <git@chron.visiondesigns.de>
Date: Mon, 15 Jan 2024 07:44:16 +0100
Subject: [PATCH] Increase CMake minimum version to 3.5 (fixes #2159)
---
CMakeLists.txt | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1b3a79de9..c02301c98 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,11 +1,4 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
-if(POLICY CMP0025)
- # detect Apple's Clang
- cmake_policy(SET CMP0025 NEW)
-endif()
-if(POLICY CMP0054)
- cmake_policy(SET CMP0054 NEW)
-endif()
+CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules)

View File

@ -0,0 +1,22 @@
From cdcb81af96c42a55686a0940734fc042636c6ad2 Mon Sep 17 00:00:00 2001
From: Rudi Heitbaum <rudi@heitbaum.com>
Date: Fri, 28 Mar 2025 22:41:11 +1100
Subject: [PATCH] allow build with cmake-4.0.0
use min...max syntax to allow build with newer cmake.
ref: https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ab7c6a81..0a6d3bc0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.3.2)
+cmake_minimum_required (VERSION 3.3.2...3.10)
project (libde265
LANGUAGES C CXX

View File

@ -0,0 +1,38 @@
From c9db6e993d4e440a276f2918f48de0868fe98093 Mon Sep 17 00:00:00 2001
From: Rudi Heitbaum <rudi@heitbaum.com>
Date: Fri, 28 Mar 2025 04:45:44 +0000
Subject: [PATCH] Update cmake_minimum_required to 3.5 consisently across
CMakeLists
Source/GmmLib/CMakeLists.txt already is requiring CMake 3.5. Update
remaining files to 3.5. This supports the compilation with cmake-4.0.0
Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
---
CMakeLists.txt | 2 +-
Source/GmmLib/os_release_info.cmake | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1a3ad36d..ca421047 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.1 FATAL_ERROR)
+cmake_minimum_required (VERSION 3.5 FATAL_ERROR)
if (NOT DEFINED RUN_TEST_SUITE)
option (RUN_TEST_SUITE "run test suite after install" ON)
diff --git a/Source/GmmLib/os_release_info.cmake b/Source/GmmLib/os_release_info.cmake
index 70c83186..0951a4a3 100755
--- a/Source/GmmLib/os_release_info.cmake
+++ b/Source/GmmLib/os_release_info.cmake
@@ -28,7 +28,7 @@ if(NOT DEFINED _os_release_info)
set(_os_release_info TRUE)
# Set cmake policies for at least this level:
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.5)
if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)

View File

@ -0,0 +1,182 @@
From c8a2c037e25498e366467860b461b8681cea5356 Mon Sep 17 00:00:00 2001
From: Rudi Heitbaum <rudi@heitbaum.com>
Date: Fri, 28 Mar 2025 05:06:53 +0000
Subject: [PATCH] [Media Common] Update cmake_minimum_required to 3.5
consisently across CMakeLists
Some of the CMakeLists.txt are already requiring CMake 3.5.
Update remaining files to 3.5.
This supports the compilation with cmake-4.0.0
Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
---
Tools/MediaDriverTools/GenDmyHex/CMakeLists.txt | 2 +-
Tools/MediaDriverTools/GenKrnBin/CMakeLists.txt | 2 +-
Tools/MediaDriverTools/KernelBinToSource/CMakeLists.txt | 2 +-
Tools/MediaDriverTools/KrnToHex/CMakeLists.txt | 2 +-
Tools/MediaDriverTools/KrnToHex_IGA/CMakeLists.txt | 2 +-
cmrtlib/CMakeLists.txt | 2 +-
cmrtlib/linux/CMakeLists.txt | 2 +-
media_driver/linux/ult/CMakeLists.txt | 2 +-
media_driver/linux/ult/libdrm_mock/CMakeLists.txt | 2 +-
media_driver/linux/ult/ult_app/CMakeLists.txt | 2 +-
media_driver/linux/ult/ult_app/googletest/CMakeLists.txt | 2 +-
os_release_info.cmake | 2 +-
12 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/Tools/MediaDriverTools/GenDmyHex/CMakeLists.txt b/Tools/MediaDriverTools/GenDmyHex/CMakeLists.txt
index 2c72d282d2b..025b9354254 100644
--- a/Tools/MediaDriverTools/GenDmyHex/CMakeLists.txt
+++ b/Tools/MediaDriverTools/GenDmyHex/CMakeLists.txt
@@ -18,7 +18,7 @@
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
-cmake_minimum_required (VERSION 2.8)
+cmake_minimum_required(VERSION 3.5)
project(IntelGenDmyHexTool)
add_compile_options(-std=c++11)
diff --git a/Tools/MediaDriverTools/GenKrnBin/CMakeLists.txt b/Tools/MediaDriverTools/GenKrnBin/CMakeLists.txt
index cc586ba766d..519ca954d33 100644
--- a/Tools/MediaDriverTools/GenKrnBin/CMakeLists.txt
+++ b/Tools/MediaDriverTools/GenKrnBin/CMakeLists.txt
@@ -18,7 +18,7 @@
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 3.5)
project(GenKrnBin)
diff --git a/Tools/MediaDriverTools/KernelBinToSource/CMakeLists.txt b/Tools/MediaDriverTools/KernelBinToSource/CMakeLists.txt
index 713d08600ec..91eacf15d8b 100644
--- a/Tools/MediaDriverTools/KernelBinToSource/CMakeLists.txt
+++ b/Tools/MediaDriverTools/KernelBinToSource/CMakeLists.txt
@@ -18,7 +18,7 @@
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
-cmake_minimum_required (VERSION 2.8)
+cmake_minimum_required(VERSION 3.5)
project(IntelKernelBinToSourceTool)
add_compile_options(-std=c++11)
diff --git a/Tools/MediaDriverTools/KrnToHex/CMakeLists.txt b/Tools/MediaDriverTools/KrnToHex/CMakeLists.txt
index a3cb7341c6e..e2bfde5e884 100644
--- a/Tools/MediaDriverTools/KrnToHex/CMakeLists.txt
+++ b/Tools/MediaDriverTools/KrnToHex/CMakeLists.txt
@@ -18,7 +18,7 @@
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
-cmake_minimum_required (VERSION 2.8)
+cmake_minimum_required(VERSION 3.5)
project(KrnToHexTool)
add_compile_options(-std=c++11)
diff --git a/Tools/MediaDriverTools/KrnToHex_IGA/CMakeLists.txt b/Tools/MediaDriverTools/KrnToHex_IGA/CMakeLists.txt
index af622be19cb..40e4eba171e 100644
--- a/Tools/MediaDriverTools/KrnToHex_IGA/CMakeLists.txt
+++ b/Tools/MediaDriverTools/KrnToHex_IGA/CMakeLists.txt
@@ -18,7 +18,7 @@
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 3.5)
project(KrnToHex_IGA)
diff --git a/cmrtlib/CMakeLists.txt b/cmrtlib/CMakeLists.txt
index 9ecb1e4e10a..54f907b3772 100644
--- a/cmrtlib/CMakeLists.txt
+++ b/cmrtlib/CMakeLists.txt
@@ -19,7 +19,7 @@
# OTHER DEALINGS IN THE SOFTWARE.
set(BUILD_ALL $ENV{BUILD_ALL})
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.5)
project(CM_RT)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/linux)
diff --git a/cmrtlib/linux/CMakeLists.txt b/cmrtlib/linux/CMakeLists.txt
index b066138d9df..df02bab2a69 100644
--- a/cmrtlib/linux/CMakeLists.txt
+++ b/cmrtlib/linux/CMakeLists.txt
@@ -18,7 +18,7 @@
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.5)
include (${CMAKE_CURRENT_LIST_DIR}/cmrt_utils.cmake)
diff --git a/media_driver/linux/ult/CMakeLists.txt b/media_driver/linux/ult/CMakeLists.txt
index 9fb5b39ee42..f06b490110b 100644
--- a/media_driver/linux/ult/CMakeLists.txt
+++ b/media_driver/linux/ult/CMakeLists.txt
@@ -17,7 +17,7 @@
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
-cmake_minimum_required(VERSION 3.1)
+cmake_minimum_required(VERSION 3.5)
if ("${BUILD_TYPE}" STREQUAL "debug")
set(CMAKE_BUILD_TYPE "Debug")
diff --git a/media_driver/linux/ult/libdrm_mock/CMakeLists.txt b/media_driver/linux/ult/libdrm_mock/CMakeLists.txt
index 438715a91c3..e5d2c88ed5b 100644
--- a/media_driver/linux/ult/libdrm_mock/CMakeLists.txt
+++ b/media_driver/linux/ult/libdrm_mock/CMakeLists.txt
@@ -17,7 +17,7 @@
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.5)
project(libdrm_mock)
diff --git a/media_driver/linux/ult/ult_app/CMakeLists.txt b/media_driver/linux/ult/ult_app/CMakeLists.txt
index 1b24fed7fc5..64217b9fe65 100644
--- a/media_driver/linux/ult/ult_app/CMakeLists.txt
+++ b/media_driver/linux/ult/ult_app/CMakeLists.txt
@@ -17,7 +17,7 @@
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
-cmake_minimum_required(VERSION 3.1)
+cmake_minimum_required(VERSION 3.5)
project(devult)
diff --git a/media_driver/linux/ult/ult_app/googletest/CMakeLists.txt b/media_driver/linux/ult/ult_app/googletest/CMakeLists.txt
index 6b1f7433596..bba044a97d8 100644
--- a/media_driver/linux/ult/ult_app/googletest/CMakeLists.txt
+++ b/media_driver/linux/ult/ult_app/googletest/CMakeLists.txt
@@ -17,7 +17,7 @@
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.5)
project(devult)
diff --git a/os_release_info.cmake b/os_release_info.cmake
index b4a84e2c5cb..a3b879d8545 100644
--- a/os_release_info.cmake
+++ b/os_release_info.cmake
@@ -29,7 +29,7 @@ set(_os_release_info TRUE)
# of the local cmake environment.
# Set cmake policies for at least this level:
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.5)
# Function get_os_release_info - Determine and return OS name and version