]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fixes CMake version > 3.12 python-binding build failure due to deprecated FindPythonI... 13631/head
authorCorbin Foucart <corbin.foucart@gmail.com>
Fri, 22 Apr 2022 05:56:30 +0000 (01:56 -0400)
committerCorbin Foucart <corbin.foucart@gmail.com>
Tue, 10 May 2022 17:48:36 +0000 (13:48 -0400)
contrib/python-bindings/CMakeLists.txt

index 51e72bf7c8438e22f3a63b02d5021870ce397275..258b04e2dd6e36cdd8b1dc1ca58fc0f6616c4faf 100644 (file)
@@ -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)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.