Skip to content

Commit 4a2cb08

Browse files
Update and simplify CMake minimum version requirements
1 parent eef2697 commit 4a2cb08

File tree

5 files changed

+7
-19
lines changed

5 files changed

+7
-19
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
if(${CMAKE_VERSION} VERSION_LESS 3.27.0)
22
cmake_minimum_required(VERSION 3.0)
33
else()
4-
cmake_minimum_required(VERSION 3.10)
4+
cmake_minimum_required(VERSION 3.27)
55
endif()
66

77
project(plog VERSION 1.1.10 LANGUAGES CXX)
@@ -16,7 +16,7 @@ endif()
1616
# options
1717
option(PLOG_BUILD_SAMPLES "Build ${PROJECT_NAME} samples" ${IS_TOPLEVEL_PROJECT})
1818
option(PLOG_INSTALL "Generate ${PROJECT_NAME} install target" ${IS_TOPLEVEL_PROJECT})
19-
option(PLOG_BUILD_TESTS "Build tests" OFF)
19+
option(PLOG_BUILD_TESTS "Build tests" ON)
2020

2121
# make sure install paths work on all platforms
2222
include(GNUInstallDirs)

samples/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
if(${CMAKE_VERSION} VERSION_LESS 3.27.0)
22
cmake_minimum_required(VERSION 3.0)
3-
elseif(${CMAKE_VERSION} VERSION_LESS 3.31.0)
4-
cmake_minimum_required(VERSION 3.6)
53
else()
6-
cmake_minimum_required(VERSION 3.10)
4+
cmake_minimum_required(VERSION 3.27)
75
endif()
86

97
if(POLICY CMP0063) #Honor visibility properties for all target types

samples/CXX11/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
if(NOT CMAKE_VERSION VERSION_LESS 3.3.0)
22
if(${CMAKE_VERSION} VERSION_LESS 3.27.0)
33
cmake_minimum_required(VERSION 3.3)
4-
elseif(${CMAKE_VERSION} VERSION_LESS 3.31.0)
5-
cmake_minimum_required(VERSION 3.6)
64
else()
7-
cmake_minimum_required(VERSION 3.10)
5+
cmake_minimum_required(VERSION 3.27)
86
endif()
97

108
if(cxx_std_11 IN_LIST CMAKE_CXX_COMPILE_FEATURES)

samples/CXX17/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
if(NOT CMAKE_VERSION VERSION_LESS 3.3.0)
22
if(${CMAKE_VERSION} VERSION_LESS 3.27.0)
33
cmake_minimum_required(VERSION 3.3)
4-
elseif(${CMAKE_VERSION} VERSION_LESS 3.31.0)
5-
cmake_minimum_required(VERSION 3.6)
64
else()
7-
cmake_minimum_required(VERSION 3.10)
5+
cmake_minimum_required(VERSION 3.27)
86
endif()
97

108
# Unfortunately cxx_std_17 in CMAKE_CXX_COMPILE_FEATURES is not reliable, so check include files

test/CMakeLists.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
if(${CMAKE_VERSION} VERSION_LESS 3.27.0)
22
cmake_minimum_required(VERSION 3.1)
3-
elseif(${CMAKE_VERSION} VERSION_LESS 3.31.0)
4-
cmake_minimum_required(VERSION 3.6)
53
else()
6-
cmake_minimum_required(VERSION 3.10)
4+
cmake_minimum_required(VERSION 3.27)
75
endif()
86

97
project(PlogTest CXX)
@@ -103,12 +101,8 @@ plog_add_test_wchar(${PROJECT_NAME}_wchar)
103101

104102
if(CMAKE_VERSION VERSION_LESS 3.8.0)
105103
return()
106-
endif()
107-
108-
if(${CMAKE_VERSION} VERSION_LESS 3.31.0)
104+
elseif(${CMAKE_VERSION} VERSION_LESS 3.27.0)
109105
cmake_policy(VERSION 3.8)
110-
else()
111-
cmake_policy(VERSION 3.10)
112106
endif()
113107

114108
set(PLOG_CXX_STANDARDS_LIST LIST cxx_std_11 cxx_std_14 cxx_std_17 cxx_std_20 cxx_std_23)

0 commit comments

Comments
 (0)