Skip to content

Commit bcb20bb

Browse files
Greg Millercopybara-github
authored andcommitted
Update the min required CMake version to 3.10
This change also removes policy settings that are now already set to `NEW` by default. There are still two remaining policies that were introduced in CMake > 3.10, so I left those, and documented the CMake version they were introduced in so we know when we can later remove them (when our min version advances beyond that). The min CMake version supported by Protobuf is documented here: https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md PiperOrigin-RevId: 511897379
1 parent d82d8a4 commit bcb20bb

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

CMakeLists.txt

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,18 @@
11
# Minimum CMake required
2-
cmake_minimum_required(VERSION 3.5)
2+
cmake_minimum_required(VERSION 3.10)
33

44
if(protobuf_VERBOSE)
55
message(STATUS "Protocol Buffers Configuring...")
66
endif()
77

8-
# CMake policies
9-
cmake_policy(SET CMP0022 NEW)
10-
# On MacOS use @rpath/ for target's install name prefix path
11-
if (POLICY CMP0042)
12-
cmake_policy(SET CMP0042 NEW)
13-
endif ()
14-
# Clear VERSION variables when no VERSION is given to project()
15-
if(POLICY CMP0048)
16-
cmake_policy(SET CMP0048 NEW)
17-
endif()
188
# MSVC runtime library flags are selected by an abstraction.
9+
# New in CMake 3.15: https://cmake.org/cmake/help/latest/policy/CMP0091.html
1910
if(POLICY CMP0091)
2011
cmake_policy(SET CMP0091 NEW)
2112
endif()
22-
# Honor visibility properties for all target types.
23-
if(POLICY CMP0063)
24-
cmake_policy(SET CMP0063 NEW)
25-
endif()
26-
# option() honor variables
13+
14+
# option() honors normal variables
15+
# New in CMake 3.13: https://cmake.org/cmake/help/latest/policy/CMP0077.html
2716
if (POLICY CMP0077)
2817
cmake_policy(SET CMP0077 NEW)
2918
endif (POLICY CMP0077)

0 commit comments

Comments
 (0)