Skip to content

Commit fb95c74

Browse files
committed
CMakeLists: update min version to 3.22 for CMake >= 4.0 support
Update minimum version of CMake to 3.22 for CMake >= 4.0 version support. New CMake require 3.5 as the minimum version with that increased to 3.10 in the next CMake release. Drop old redundant CMake condition not needed anymore due to new version requirement. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
1 parent 23c1374 commit fb95c74

File tree

1 file changed

+7
-30
lines changed

1 file changed

+7
-30
lines changed

CMakeLists.txt

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required (VERSION 2.8.11)
1+
cmake_minimum_required (VERSION 3.22)
22
project (upm)
33

44
# Before going any further, define build options
@@ -260,37 +260,14 @@ set (upm_VERSION_STRING ${upm_VERSION_MAJOR}.${upm_VERSION_MINOR}.${upm_VERSION_
260260

261261
# enable c++11 standards support unconditionally
262262
include(CheckCXXCompilerFlag)
263-
if (CMAKE_VERSION VERSION_LESS "3.1")
264-
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
265-
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
266-
if (COMPILER_SUPPORTS_CXX11)
267-
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
268-
elseif (COMPILER_SUPPORTS_CXX0X)
269-
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
270-
else()
271-
message(FATAL_ERROR "A C++11 compliant compiler is required to build UPM.")
272-
endif()
273-
else()
274-
# 3.1+ uses this generic method to enable c++11
275-
set (CMAKE_CXX_STANDARD 11)
276-
set (CXX_STANDARD_REQUIRED ON)
277-
set (CXX_EXTENSIONS OFF)
278-
endif()
263+
set (CMAKE_CXX_STANDARD 11)
264+
set (CXX_STANDARD_REQUIRED ON)
265+
set (CXX_EXTENSIONS OFF)
279266

280267
include(CheckCCompilerFlag)
281-
if (CMAKE_VERSION VERSION_LESS "3.1")
282-
CHECK_C_COMPILER_FLAG("-std=c11" COMPILER_SUPPORTS_C11)
283-
if (COMPILER_SUPPORTS_C11)
284-
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
285-
else()
286-
message(FATAL_ERROR "A C11 compliant C compiler is required to build UPM.")
287-
endif()
288-
else()
289-
# 3.1+ uses this generic method to enable c11
290-
set (CMAKE_C_STANDARD 11)
291-
set (C_STANDARD_REQUIRED ON)
292-
set (C_EXTENSIONS OFF)
293-
endif()
268+
set (CMAKE_C_STANDARD 11)
269+
set (C_STANDARD_REQUIRED ON)
270+
set (C_EXTENSIONS OFF)
294271

295272
# The doc target depends on the C/C++ source and all libraries
296273
#

0 commit comments

Comments
 (0)