Skip to content

Commit

Permalink
Set CMake policies for newer versions of CMake
Browse files Browse the repository at this point in the history
Make sure that CMP0012 is set to NEW, without which FindPython3 and
FindPython2 functionality becomes broken with CMake 3.18.2 if searching
by location. CMP0012 being set to OLD is also deprecated as of 3.18.3.
Ensure CMP0011 is set to NEW to avoid warnings and deprecated behaviour
being issued about policy push / pop with CMake 3.18.0 or newer.

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
  • Loading branch information
paul-elliott-arm committed Oct 1, 2020
1 parent 2cb88c9 commit 7a55b22
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
#

cmake_minimum_required(VERSION 2.6)

# https://cmake.org/cmake/help/latest/policy/CMP0011.html
# Fix warnings in CMake >= 3.18.0. OLD is deprecated.
cmake_policy(SET CMP0011 NEW)
# https://cmake.org/cmake/help/latest/policy/CMP0012.html
# We require this for FindPython3 to work with CMake 3.18.2, but this will also generate warnings in
# CMake >= 3.18.3 if unset. OLD is again deprecated.
cmake_policy(SET CMP0012 NEW)

if(TEST_CPP)
project("mbed TLS" C CXX)
else()
Expand Down

0 comments on commit 7a55b22

Please sign in to comment.