|
1 |
| -cmake_minimum_required(VERSION 2.8.12) |
2 |
| - |
3 |
| -if (POLICY CMP0025) |
4 |
| - cmake_policy(SET CMP0025 NEW) |
5 |
| -endif() |
| 1 | +# https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md |
| 2 | +# As of 2024-07-01, CMake 3.16 is the minimum supported version. |
| 3 | +cmake_minimum_required(VERSION 3.16) |
6 | 4 |
|
7 | 5 | project(cctz)
|
8 | 6 |
|
@@ -51,20 +49,12 @@ if (BUILD_TESTING)
|
51 | 49 | )
|
52 | 50 | endif()
|
53 | 51 |
|
54 |
| -# Starting from CMake >= 3.1, if a specific standard is required, |
| 52 | +# If a specific standard is required, |
55 | 53 | # it can be set from the command line with:
|
56 |
| -# cmake -DCMAKE_CXX_STANDARD=[11|14|17] |
| 54 | +# cmake -DCMAKE_CXX_STANDARD=[11|14|17|20|23] |
57 | 55 | function(cctz_target_set_cxx_standard target)
|
58 | 56 | set(cxx_standard 11)
|
59 |
| - if (CMAKE_VERSION VERSION_LESS "3.1") |
60 |
| - if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") |
61 |
| - target_compile_options(${target} PRIVATE -std=c++${cxx_standard}) |
62 |
| - endif() |
63 |
| - elseif (CMAKE_VERSION VERSION_LESS "3.8") |
64 |
| - set_property(TARGET ${target} PROPERTY CXX_STANDARD ${cxx_standard}) |
65 |
| - else() |
66 |
| - target_compile_features(${target} PUBLIC cxx_std_${cxx_standard}) |
67 |
| - endif() |
| 57 | + target_compile_features(${target} PUBLIC cxx_std_${cxx_standard}) |
68 | 58 | endfunction()
|
69 | 59 |
|
70 | 60 | if(APPLE)
|
@@ -191,10 +181,6 @@ install(FILES cmake/${PROJECT_NAME}-config.cmake
|
191 | 181 | DESTINATION ${CMAKE_INSTALL_CONFIGDIR}
|
192 | 182 | )
|
193 | 183 |
|
194 |
| -if (CMAKE_VERSION VERSION_LESS "3.8") |
195 |
| - set(quiet_on_empty "") |
196 |
| -else() |
197 |
| - set(quiet_on_empty QUIET_ON_EMPTY) |
198 |
| -endif() |
| 184 | +set(quiet_on_empty QUIET_ON_EMPTY) |
199 | 185 |
|
200 | 186 | feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES ${quiet_on_empty})
|
0 commit comments