From 3c0a6bbe6a753e0d49691b9f92f9f72023edffe2 Mon Sep 17 00:00:00 2001 From: Corbin Foucart Date: Fri, 22 Apr 2022 01:56:30 -0400 Subject: [PATCH] Fixes CMake version > 3.12 python-binding build failure due to deprecated FindPythonInterp call. --- contrib/python-bindings/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/contrib/python-bindings/CMakeLists.txt b/contrib/python-bindings/CMakeLists.txt index 51e72bf7c8..258b04e2dd 100644 --- a/contrib/python-bindings/CMakeLists.txt +++ b/contrib/python-bindings/CMakeLists.txt @@ -21,7 +21,14 @@ IF(DEAL_II_COMPONENT_PYTHON_BINDINGS) # # Find Python: # - INCLUDE(FindPythonInterp) + # Since CMake 3.12, FindPythonInterp is deprecated. + if (CMAKE_VERSION VERSION_LESS 3.12) + INCLUDE(FindPythonInterp) + else() + FIND_PACKAGE(Python3) + set(PYTHON_VERSION_MAJOR ${Python3_VERSION_MAJOR}) + set(PYTHON_VERSION_MINOR ${Python3_VERSION_MINOR}) + endif() INCLUDE(FindPythonLibs) IF(FEATURE_BOOST_BUNDLED_CONFIGURED) -- 2.39.5