]> git.lyx.org Git - lyx.git/blobdiff - CMakeLists.txt
Use std::regex if possible
[lyx.git] / CMakeLists.txt
index 86f6a018069511b087faf8c5e823a8acbe50ab2d..294dbe4c1e3bce58226f0ca9acc317f3ebb4fc3c 100644 (file)
@@ -246,13 +246,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
-               # <regex> and <tr1/regex> in gcc are unusable in versions less than 4.9.0
+       if(GCC_VERSION VERSION_LESS 4.9)
+               # <regex> 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_TR1_REGEX 0)
+               set(LYX_USE_STD_REGEX 0)
        endif()
        if (LYX_ENABLE_CXX11)
                find_package(CXX11Compiler)
@@ -262,10 +259,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()
 
 
@@ -557,6 +554,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})
@@ -641,7 +639,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)