Cmake build: Consider for cmake versions <= 3.12 while searching for python

This partially reverts d17dfe6f
This commit is contained in:
Kornel Benko 2019-11-28 21:51:47 +01:00
parent d17dfe6fb2
commit 5e436ce9e5

View File

@ -792,6 +792,16 @@ unset(LYX_PYTHON_EXECUTABLE CACHE)
unset(PYTHON_VERSION_MAJOR) unset(PYTHON_VERSION_MAJOR)
unset(PYTHON_VERSION_MINOR) unset(PYTHON_VERSION_MINOR)
unset(PYTHON_VERSION_STRING) unset(PYTHON_VERSION_STRING)
if (CMAKE_VERSION VERSION_LESS "3.13")
find_package(PythonInterp 3.5 QUIET)
if(NOT PYTHONINTERP_FOUND)
find_package(PythonInterp 2.0 REQUIRED)
if(NOT PYTHON_VERSION_STRING VERSION_LESS 2.8)
message(FATAL_ERROR "Python interpreter found, but is not suitable")
endif()
endif()
set(LYX_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "Python to be used by LyX")
else()
find_package(Python3 3.5 QUIET) find_package(Python3 3.5 QUIET)
if(NOT Python3_Interpreter_FOUND) if(NOT Python3_Interpreter_FOUND)
unset(PYTHON_EXECUTABLE CACHE) unset(PYTHON_EXECUTABLE CACHE)
@ -803,6 +813,7 @@ if(NOT Python3_Interpreter_FOUND)
else() else()
set(LYX_PYTHON_EXECUTABLE ${Python3_EXECUTABLE} CACHE FILEPATH "Python to be used by LyX") set(LYX_PYTHON_EXECUTABLE ${Python3_EXECUTABLE} CACHE FILEPATH "Python to be used by LyX")
endif() endif()
endif()
if(LYX_NLS) if(LYX_NLS)
find_package(LyXGettext) find_package(LyXGettext)