Skip to content

Commit

Permalink
Update the min required CMake version to 3.10
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Greg Miller authored and copybara-github committed Feb 23, 2023
1 parent d82d8a4 commit bcb20bb
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,29 +1,18 @@
# Minimum CMake required
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)

if(protobuf_VERBOSE)
message(STATUS "Protocol Buffers Configuring...")
endif()

# CMake policies
cmake_policy(SET CMP0022 NEW)
# On MacOS use @rpath/ for target's install name prefix path
if (POLICY CMP0042)
cmake_policy(SET CMP0042 NEW)
endif ()
# Clear VERSION variables when no VERSION is given to project()
if(POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
endif()
# MSVC runtime library flags are selected by an abstraction.
# New in CMake 3.15: https://cmake.org/cmake/help/latest/policy/CMP0091.html
if(POLICY CMP0091)
cmake_policy(SET CMP0091 NEW)
endif()
# Honor visibility properties for all target types.
if(POLICY CMP0063)
cmake_policy(SET CMP0063 NEW)
endif()
# option() honor variables

# option() honors normal variables
# New in CMake 3.13: https://cmake.org/cmake/help/latest/policy/CMP0077.html
if (POLICY CMP0077)
cmake_policy(SET CMP0077 NEW)
endif (POLICY CMP0077)
Expand Down

0 comments on commit bcb20bb

Please sign in to comment.