5 # https://cmake.org/cmake/help/latest/module/FindPythonInterp.html
6 # https://cmake.org/cmake/help/latest/module/FindPythonLibs.html
7 # https://cmake.org/cmake/help/latest/module/FindPython.html
12 # This module defines the following variables:
14 # ``PYTHON_FOUND``, ``Python_FOUND``
16 # ``PYTHON_EXECUTABLE``, ``Python_EXECUTABLE``
18 if(CMAKE_VERSION VERSION_LESS 3.12)
19 set(PythonInterp_FIND_VERSION ${Python_FIND_VERSION})
20 include(${CMAKE_ROOT}/Modules/FindPythonInterp.cmake)
21 list(FIND Python_FIND_COMPONENTS Development PYTHON_FOUND)
22 if(${PYTHON_FOUND} GREATER -1)
23 list(INSERT Python_ADDITIONAL_VERSIONS 0 ${Python_FIND_VERSION})
24 list(INSERT Python_ADDITIONAL_VERSIONS 0 ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
25 include(${CMAKE_ROOT}/Modules/FindPythonLibs.cmake)
27 set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
28 set(PYTHON_FOUND ${PYTHONINTERP_FOUND})
29 set(Python_FOUND ${PYTHONINTERP_FOUND})
31 include(${CMAKE_ROOT}/Modules/FindPython.cmake)
32 set(PYTHON_EXECUTABLE ${Python_EXECUTABLE})
33 set(PYTHON_FOUND ${Python_FOUND})