[PATCH] kernelshark: Allow building with CMake 4+

Michal Sojka <[email protected]> Fri, 10 Oct 2025 15:17:15 +0200
Newsgroups org.kernel.vger.linux-trace-devel
Message-ID <[email protected]>
CMake 4.0 removed compatibility with versions of CMake older than 3.5
[1]. In order to builde Kernelshark with CMake 4, at least version 3.5
needs to be declared. However, versions older than 3.10 are deprecated
so it's probably better to upgrade directly to 3.10.

To support builds with older CMake, as before, we use the "..." syntax
in cmake_minimum_required [3].

[1]: https://cmake.org/cmake/help/latest/release/4.0.html#deprecated-and-removed-features
[2]: https://cmake.org/cmake/help/latest/release/3.31.html#deprecated-and-removed-features
[3]: https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html#command:cmake_minimum_required

Signed-off-by: Michal Sojka <[email protected]>
---
 CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6aa1a5b..54ff97c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
 # Check if cmake has the required version
-cmake_minimum_required(VERSION 3.1.2 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.1.2...3.10)
 
 # Set the name and version of the project
 project(kernel-shark)
-- 
2.51.0