X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=CMakeLists.txt;h=531532627d1d20d1fdaea79c0e19b98946e6ff27;hb=1136bc4fb276e9182fb461ffdfbddcc58b622762;hp=3f491581b821fb0f6e4655008794e4a0527b7238;hpb=9c55af4a223ce4db29d643251109e245665344bd;p=lyx.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f491581b8..531532627d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,8 +68,15 @@ if(LYX_XMINGW) endif() if(NOT help AND NOT HELP) - # 'project' triggers the searching for a compiler - project(${LYX_PROJECT}) + # 'project' triggers the searching for a compiler + project(${LYX_PROJECT}) + if (CMAKE_COMPILER_IS_GNUCXX) + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.0") + message(STATUS "Gnu CXX compiler version = ${CMAKE_CXX_COMPILER_VERSION}") + message(STATUS "is too old, should be >= 4.0") + message(FATAL_ERROR "Exiting") + endif() + endif() endif() if(UNIX) @@ -608,8 +615,24 @@ foreach(_spell "ASPELL" "Enchant" "Hunspell") endif() endforeach() +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) + unset(PYTHON_EXECUTABLE CACHE) + unset(PYTHON_VERSION_MAJOR) + unset(PYTHON_VERSION_MINOR) + unset(PYTHON_VERSION_STRING) + find_package(PythonInterp 3.3 REQUIRED) +endif() + +set(LYX_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "Python to be used by LyX") + if(LYX_NLS) - FIND_PROGRAM(LYX_PYTHON_EXECUTABLE python2 python HINTS ${GNUWIN32_DIR}/python) find_package(LyXGettext) if(LYX_PYTHON_EXECUTABLE AND GETTEXT_FOUND) add_subdirectory(po "${TOP_BINARY_DIR}/po")