X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=CMakeLists.txt;h=531532627d1d20d1fdaea79c0e19b98946e6ff27;hb=b596330093d3fa5d80e3ffc185771df77a02393b;hp=0db64f7341842ad4d1df3ab60ad9e2ca180872f7;hpb=edf22ba723066d80a223b2d04763ff1d22aa3a30;p=lyx.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 0db64f7341..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) @@ -246,11 +253,10 @@ set(LYX_GCC11_MODE) if(UNIX OR MINGW) execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) message(STATUS "Using GCC version ${GCC_VERSION}") - if(NOT GCC_VERSION VERSION_LESS 4.4) - set(LYX_USE_TR1 1) - # GCC <= 4.5 does not support regex: there are linker errors - # http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.tr1 - set(LYX_USE_TR1_REGEX 0) + if(GCC_VERSION VERSION_LESS 4.9) + # in gcc is unusable in versions less than 4.9.0 + # see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53631 + set(LYX_USE_STD_REGEX 0) endif() if (LYX_ENABLE_CXX11) find_package(CXX11Compiler) @@ -260,10 +266,10 @@ if(UNIX OR MINGW) set(LYX_GCC11_MODE "${CXX11_FLAG}") endif() else() - if(MSVC10) - set(LYX_USE_TR1 1) - #set(LYX_USE_TR1_REGEX 1) #TODO should we use it in ECMAScript mode? - endif() + set(LYX_USE_STD_REGEX 0) +# if(MSVC10) +# set(LYX_USE_STD_REGEX 1) #TODO should we use it in ECMAScript mode? +# endif() endif() @@ -555,6 +561,7 @@ if(LYX_USE_QT MATCHES "QT5") find_package(Qt5MacExtras REQUIRED) endif() find_package(Qt5X11Extras QUIET) + find_package(Qt5WinExtras QUIET) set(QTVERSION ${Qt5Core_VERSION}) macro (qt_use_modules) qt5_use_modules(${ARGN}) @@ -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") @@ -630,7 +653,11 @@ find_package(ZLIB REQUIRED) if(LYX_EXTERNAL_BOOST) message(STATUS "Searching for boost") - find_package(Boost COMPONENTS signals regex) #TODO could REQUIRED be used + if(LYX_USE_STD_REGEX) + find_package(Boost COMPONENTS signals) + else() + find_package(Boost COMPONENTS signals regex) + endif() if(Boost_FOUND) message(STATUS "Boost found") message(STATUS "Boost-libs = ${Boost_LIBRARIES}") @@ -639,7 +666,7 @@ if(LYX_EXTERNAL_BOOST) message(FATAL_ERROR "Boost not found" ${Boost_ERROR_REASON}) endif() else() - if(LYX_USE_TR1_REGEX) + if(LYX_USE_STD_REGEX) set(Lyx_Boost_Libraries boost_signals) else() set(Lyx_Boost_Libraries boost_signals boost_regex)