Increase CMake minimum version to 3.5 (fixes #2159)

This commit is contained in:
Christian Fersch 2024-01-15 07:44:16 +01:00 committed by Milo Yip
parent 858451e5b7
commit ebd87cb468

View File

@ -1,11 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)
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)
@ -14,12 +7,7 @@ set(LIB_MINOR_VERSION "1")
set(LIB_PATCH_VERSION "0")
set(LIB_VERSION_STRING "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}.${LIB_PATCH_VERSION}")
if (CMAKE_VERSION VERSION_LESS 3.0)
PROJECT(RapidJSON CXX)
else()
cmake_policy(SET CMP0048 NEW)
PROJECT(RapidJSON VERSION "${LIB_VERSION_STRING}" LANGUAGES CXX)
endif()
PROJECT(RapidJSON VERSION "${LIB_VERSION_STRING}" LANGUAGES CXX)
# compile in release with debug info mode by default
if(NOT CMAKE_BUILD_TYPE)