X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=CMakeLists.txt;h=39880f24ef63f35da39e8fcf29e4d7167fdd5a89;hb=86d2a203b060481a663356427e56a1c229f3fd6c;hp=e10ab3d8326dcaad151600c172fb70f50d902f82;hpb=407bb15bde28ec1cf4886def32ae38498e4ad66a;p=lyx.git diff --git a/CMakeLists.txt b/CMakeLists.txt index e10ab3d832..39880f24ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -640,24 +640,25 @@ foreach(_spell "ASPELL" "Enchant" "Hunspell") endif() endforeach() +if(NOT LYX_PYTHON_EXECUTABLE) + find_package(PythonInterp 2.7 QUIET) + if(PYTHONINTERP_FOUND) + if(PYTHON_VERSION_STRING VERSION_GREATER 2.8) + unset(PYTHONINTERP_FOUND) + endif() + endif() -find_package(PythonInterp 2.7 QUIET) -if(PYTHONINTERP_FOUND) - if(PYTHON_VERSION_STRING VERSION_GREATER 2.8) - unset(PYTHONINTERP_FOUND) - endif() -endif() + if(NOT PYTHONINTERP_FOUND AND NOT GNUWIN32_DIR) + unset(PYTHON_EXECUTABLE CACHE) + unset(PYTHON_VERSION_MAJOR) + unset(PYTHON_VERSION_MINOR) + unset(PYTHON_VERSION_STRING) + find_package(PythonInterp 3.3 REQUIRED) + endif() -if(NOT PYTHONINTERP_FOUND AND NOT GNUWIN32_DIR) - unset(PYTHON_EXECUTABLE CACHE) - unset(PYTHON_VERSION_MAJOR) - unset(PYTHON_VERSION_MINOR) - unset(PYTHON_VERSION_STRING) - find_package(PythonInterp 3.3 REQUIRED) + set(LYX_PYTHON_EXECUTABLE ${PYTHON_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)