[LyX/master] Cmake build: Replace use of deprecated module PythonInterp
Kornel Benko
kornel at lyx.org
Thu Nov 28 13:56:46 UTC 2019
commit d17dfe6fb2cb58b4ae4ebe48f4361b924212d008
Author: Kornel Benko <kornel at lyx.org>
Date: Thu Nov 28 15:09:11 2019 +0100
Cmake build: Replace use of deprecated module PythonInterp
Use find_package(Pytnon2 ..) and find_package(Python3 ...) instead
Patch from Patrick (pdvisschere at edpnet.be)
---
CMakeLists.txt | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 779d9e9..52290e8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -792,17 +792,18 @@ unset(LYX_PYTHON_EXECUTABLE CACHE)
unset(PYTHON_VERSION_MAJOR)
unset(PYTHON_VERSION_MINOR)
unset(PYTHON_VERSION_STRING)
-find_package(PythonInterp 3.5 QUIET)
-if(NOT PYTHONINTERP_FOUND)
+find_package(Python3 3.5 QUIET)
+if(NOT Python3_Interpreter_FOUND)
unset(PYTHON_EXECUTABLE CACHE)
- find_package(PythonInterp 2.0 REQUIRED)
+ find_package(Python2 2.0 REQUIRED)
if(NOT PYTHON_VERSION_STRING VERSION_LESS 2.8)
message(FATAL_ERROR "Python interpreter found, but is not suitable")
endif()
+ set(LYX_PYTHON_EXECUTABLE ${Python2_EXECUTABLE} CACHE FILEPATH "Python to be used by LyX")
+else()
+ set(LYX_PYTHON_EXECUTABLE ${Python3_EXECUTABLE} CACHE FILEPATH "Python to be used by LyX")
endif()
-set(LYX_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "Python to be used by LyX")
-
if(LYX_NLS)
find_package(LyXGettext)
if(LYX_PYTHON_EXECUTABLE AND GETTEXT_FOUND)
More information about the lyx-cvs
mailing list