From 5f73667284d154e084775cd7a535b4316fd2c319 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 18 Sep 2025 11:49:26 +0200 Subject: [PATCH] host/firmware/tools: Update minimum CMake versions Various sub-projects around the UHD repository specify their own minimum CMake versions (independent of UHD). We modify the minimum CMake versions in the following way: - All CMake files under firmware/ are bumped from 2.6 to 3.5. This is to allow newer CMake versions to work with these files (CMake 4 and beyond do no longer work if the minimum version is below 3.5). However, note that these CMake files are so simple they will keep working with older CMake versions, but that will require manually demoting the minimum version. Because more people are using CMake versions newer than 3.5 (especially with recent checkouts of UHD), this seems the more compatible solution. - The CMake files for extension_example and init_usrp are bumped to 3.12. This matches the version that UHD uses, which increases compatibility. --- firmware/fx2/CMakeLists.txt | 4 +++- firmware/octoclock/CMakeLists.txt | 4 +++- firmware/usrp2/CMakeLists.txt | 4 +++- firmware/usrp3/CMakeLists.txt | 4 +++- host/examples/extension_example/CMakeLists.txt | 2 +- tools/dissectors/CMakeLists.txt | 2 +- 6 files changed, 14 insertions(+), 6 deletions(-) diff --git a/firmware/fx2/CMakeLists.txt b/firmware/fx2/CMakeLists.txt index 7a41333f5..1c7328db3 100644 --- a/firmware/fx2/CMakeLists.txt +++ b/firmware/fx2/CMakeLists.txt @@ -15,7 +15,9 @@ # along with this program. If not, see . # -cmake_minimum_required(VERSION 2.6) +# In a pinch, this will work with older CMake versions too (down to 2.6), +# but we set it to 3.5 to also work with newer CMake versions (4 and above). +cmake_minimum_required(VERSION 3.5) set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/config/Toolchain-sdcc.cmake) project(USRP1 C) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/config/") diff --git a/firmware/octoclock/CMakeLists.txt b/firmware/octoclock/CMakeLists.txt index 4d99add0a..8d43fbbd5 100644 --- a/firmware/octoclock/CMakeLists.txt +++ b/firmware/octoclock/CMakeLists.txt @@ -15,7 +15,9 @@ # along with this program. If not, see . # -cmake_minimum_required(VERSION 2.6) +# In a pinch, this will work with older CMake versions too (down to 2.6), +# but we set it to 3.5 to also work with newer CMake versions (4 and above). +cmake_minimum_required(VERSION 3.5) set(CMAKE_SYSTEM_NAME Generic) find_program(AVR_CC avr-gcc REQUIRED) diff --git a/firmware/usrp2/CMakeLists.txt b/firmware/usrp2/CMakeLists.txt index 693fbf9c3..67ad647bd 100644 --- a/firmware/usrp2/CMakeLists.txt +++ b/firmware/usrp2/CMakeLists.txt @@ -18,7 +18,9 @@ ######################################################################## # setup project and compiler ######################################################################## -cmake_minimum_required(VERSION 2.6) +# In a pinch, this will work with older CMake versions too (down to 2.6), +# but we set it to 3.5 to also work with newer CMake versions (4 and above). +cmake_minimum_required(VERSION 3.5) #force the compiler because the check wont use the special flag below include(CMakeForceCompiler) set(CMAKE_SYSTEM_NAME Generic) diff --git a/firmware/usrp3/CMakeLists.txt b/firmware/usrp3/CMakeLists.txt index 9cfbe9987..2843747e7 100644 --- a/firmware/usrp3/CMakeLists.txt +++ b/firmware/usrp3/CMakeLists.txt @@ -18,7 +18,9 @@ ######################################################################## # setup project and compiler ######################################################################## -cmake_minimum_required(VERSION 2.6) +# In a pinch, this will work with older CMake versions too (down to 2.6), +# but we set it to 3.5 to also work with newer CMake versions (4 and above). +cmake_minimum_required(VERSION 3.5) #force the compiler because the check wont use the special flag below include(CMakeForceCompiler) set(CMAKE_SYSTEM_NAME Generic) diff --git a/host/examples/extension_example/CMakeLists.txt b/host/examples/extension_example/CMakeLists.txt index 325e490f3..ac646d102 100644 --- a/host/examples/extension_example/CMakeLists.txt +++ b/host/examples/extension_example/CMakeLists.txt @@ -5,7 +5,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later # -cmake_minimum_required(VERSION 3.5.1) +cmake_minimum_required(VERSION 3.12) project(EXTENSION_EXAMPLE CXX) ### Configure Compiler ######################################################## diff --git a/tools/dissectors/CMakeLists.txt b/tools/dissectors/CMakeLists.txt index 8fa854203..af67ee00e 100644 --- a/tools/dissectors/CMakeLists.txt +++ b/tools/dissectors/CMakeLists.txt @@ -4,7 +4,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later # -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.5) cmake_policy(SET CMP0048 NEW) project(EttusDissectors VERSION 4.0.0 DESCRIPTION "Dissector Plugins" LANGUAGES C CXX)