Skip to content

Commit

Permalink
CMake: Bump minimal required version to 3.10
Browse files Browse the repository at this point in the history
CMake v3.10 is from 2018. All stable distributions like Ubuntu 18.04,
OpenSUSE 15 or CentOS 7 provide a version of CMake >= 3.10.

Since CMake v3.27 refuses to build anything that claims compatibility
with CMake 2.x, bump the minimal required version to CMake 3.10.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
  • Loading branch information
pcercuei committed Jul 27, 2023
1 parent 924bd0e commit 0c32263
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 18 deletions.
9 changes: 1 addition & 8 deletions CMakeLists.txt
@@ -1,5 +1,5 @@
message(STATUS "cmake version: ${CMAKE_VERSION}")
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(libiio C)

if (MINGW)
Expand Down Expand Up @@ -94,13 +94,6 @@ elseif (CMAKE_COMPILER_IS_GNUCC)
if (HAS_WSHADOW)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wshadow")
endif()
# cmake 2.8 doesn't support C_STANDARD defined in set_target_properties
if (${CMAKE_VERSION} VERSION_LESS "3.2")
check_c_compiler_flag(-std=c99 HAS_C99)
if (HAS_C99)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
endif()
endif()

# Per http://www.mingw.org/wiki/Use_more_recent_defined_functions
if (MINGW)
Expand Down
2 changes: 1 addition & 1 deletion bindings/cpp/CMakeLists.txt
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)

project(iiopp-enum CXX)
add_executable(iiopp-enum examples/iiopp-enum.cpp iiopp.h ${LIBIIO_RC})
Expand Down
2 changes: 1 addition & 1 deletion bindings/csharp/CMakeLists.txt
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(libiio-sharp NONE)

if (WIN32)
Expand Down
6 changes: 1 addition & 5 deletions bindings/python/CMakeLists.txt
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(libiio-py NONE)

if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
Expand Down Expand Up @@ -42,10 +42,6 @@ else()
endif()

if(WITH_DOC)
if(${CMAKE_VERSION} VERSION_LESS "3.2.0")
# cmake -E env was added in 3.2
message(FATAL_ERROR "Sorry, you can't build python doc with ancient cmake, please update")
endif()
find_program(SPHINX_EXECUTABLE
NAMES sphinx-build
DOC "Sphinx Documentation Builder (sphinx-doc.org)"
Expand Down
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)

project(ad9361-iiostream C)
project(ad9371-iiostream C)
Expand Down
2 changes: 1 addition & 1 deletion iiod/CMakeLists.txt
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(iiod C)

include(FindBISON)
Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)

project(iio_genxml C)
project(iio_info C)
Expand Down

0 comments on commit 0c32263

Please sign in to comment.