This is consistent with autotools. The only exception is MSVC, since we do not
know yet whether it works.
# <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)
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)
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)