commit a15aafa2a1e7fa2cedce13e15d0622bc31a3fe46
Author: Georg Baum <[email protected]>
Date:   Sun Dec 6 20:04:21 2015 +0100

    Use std::regex automatically in C++11 mode
    
    This is consistent with autotools. The only exception is MSVC, since we do 
not
    know yet whether it works.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a87b049..5840ad0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -255,6 +255,10 @@ if(UNIX OR MINGW)
                # <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_STD_REGEX 0)
+       else()
+               if (LYX_ENABLE_CXX11)
+                       set(LYX_USE_STD_REGEX 1)
+               endif()
        endif()
        if (LYX_ENABLE_CXX11)
                find_package(CXX11Compiler)
@@ -856,6 +860,10 @@ if(QTVERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+).*")
        MATH(EXPR QT4_VERSION 
"(${CMAKE_MATCH_1}<<16)|(${CMAKE_MATCH_2}<<8)|${CMAKE_MATCH_3}")
 endif()
 
+if (NOT HAVE_REGEX)
+       set(LYX_USE_STD_REGEX 0)
+endif()
+
 
 set (cmd ${CMAKE_CTEST_COMMAND})
 if (MSVC)
diff --git a/development/cmake/ConfigureChecks.cmake 
b/development/cmake/ConfigureChecks.cmake
index b29416f..46ee11f 100644
--- a/development/cmake/ConfigureChecks.cmake
+++ b/development/cmake/ConfigureChecks.cmake
@@ -33,6 +33,8 @@ foreach(_h_file aspell.h aspell/aspell.h limits.h locale.h
        check_include_files(${_h_file} HAVE_${_HF})
        set(Include_Defines "${Include_Defines}#cmakedefine HAVE_${_HF} 1\n")
 endforeach()
+check_include_file_cxx(regex HAVE_REGEX)
+set(Include_Defines "${Include_Defines}#cmakedefine HAVE_REGEX 1\n")
 configure_file(${LYX_CMAKE_DIR}/configIncludes.cmake 
${TOP_BINARY_DIR}/configIncludes.h.cmake)
 configure_file(${TOP_BINARY_DIR}/configIncludes.h.cmake 
${TOP_BINARY_DIR}/configIncludes.h)
 

Reply via email to