From: Corbin Foucart Date: Fri, 22 Apr 2022 05:56:30 +0000 (-0400) Subject: Fixes CMake version > 3.12 python-binding build failure due to deprecated FindPythonI... X-Git-Tag: v9.4.0-rc1~240^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F13631%2Fhead;p=dealii.git Fixes CMake version > 3.12 python-binding build failure due to deprecated FindPythonInterp call. --- 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)