From b86059ee6d0f72a43826104c19d42d48c0575f2f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Matos?= Date: Mon, 10 Jun 2024 10:33:33 +0100 Subject: [PATCH] Update build time Python requirement to 2.8 (cmake edition) --- CMakeLists.txt | 19 +++++-------------- src/tex2lyx/test/runtests.cmake | 6 ++---- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 26bca21728..ab165f0d1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -924,26 +924,17 @@ unset(PYTHON_VERSION_MAJOR) unset(PYTHON_VERSION_MINOR) unset(PYTHON_VERSION_STRING) if (CMAKE_VERSION VERSION_LESS "3.13") - find_package(PythonInterp 3.5 QUIET) + find_package(PythonInterp 3.8) 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() + message(FATAL_ERROR "Python interpreter not found or not suitable") 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.8) if(NOT Python3_Interpreter_FOUND) - unset(PYTHON_EXECUTABLE CACHE) - find_package(Python2 2.0 REQUIRED) - if(NOT Python2_VERSION 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") + message(FATAL_ERROR "Python interpreter not found or not suitable") endif() + set(LYX_PYTHON_EXECUTABLE ${Python3_EXECUTABLE} CACHE FILEPATH "Python to be used by LyX") endif() if(LYX_NLS) diff --git a/src/tex2lyx/test/runtests.cmake b/src/tex2lyx/test/runtests.cmake index 863490b267..2f4797ea6d 100644 --- a/src/tex2lyx/test/runtests.cmake +++ b/src/tex2lyx/test/runtests.cmake @@ -51,8 +51,8 @@ if(_configure_needed) # Get binary directory of tex2lyx string(REGEX REPLACE "(.*)tex2lyx${_suffix}.*" "\\1" _bindir "${TEX2LYX_EXE}") - message(STATUS "executing ${LYX_PYTHON_EXECUTABLE} -tt \"${SCRIPT_DIR}/../configure.py\" ${_with_ver} \"--binary-dir=${_bindir}\"") - execute_process(COMMAND ${LYX_PYTHON_EXECUTABLE} -tt "${SCRIPT_DIR}/../configure.py" + message(STATUS "executing ${LYX_PYTHON_EXECUTABLE} \"${SCRIPT_DIR}/../configure.py\" ${_with_ver} \"--binary-dir=${_bindir}\"") + execute_process(COMMAND ${LYX_PYTHON_EXECUTABLE} "${SCRIPT_DIR}/../configure.py" ${_with_ver} "--binary-dir=${_bindir}" WORKING_DIRECTORY "${LYX_TESTS_USERDIR}" ) @@ -70,5 +70,3 @@ string(COMPARE NOTEQUAL ${_err} 0 _erg) if(_erg) message(FATAL_ERROR "${PY_SCRIPT} failed") endif() - - -- 2.39.2