Skip to content

Commit 7a55b22

Browse files
Set CMake policies for newer versions of CMake
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 <[email protected]>
1 parent 2cb88c9 commit 7a55b22

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@
1717
#
1818

1919
cmake_minimum_required(VERSION 2.6)
20+
21+
# https://cmake.org/cmake/help/latest/policy/CMP0011.html
22+
# Fix warnings in CMake >= 3.18.0. OLD is deprecated.
23+
cmake_policy(SET CMP0011 NEW)
24+
# https://cmake.org/cmake/help/latest/policy/CMP0012.html
25+
# We require this for FindPython3 to work with CMake 3.18.2, but this will also generate warnings in
26+
# CMake >= 3.18.3 if unset. OLD is again deprecated.
27+
cmake_policy(SET CMP0012 NEW)
28+
2029
if(TEST_CPP)
2130
project("mbed TLS" C CXX)
2231
else()

0 commit comments

Comments
 (0)