FindCXX11Features: check for a usable std::regex
and add a config.h variable in the opm-parser test.
This commit is contained in:
parent
6947423b97
commit
c764c89da9
@ -7,6 +7,7 @@
|
|||||||
# HAVE_SHARED_PTR True if std::shared_ptr is available
|
# HAVE_SHARED_PTR True if std::shared_ptr is available
|
||||||
# HAVE_UNIQUE_PTR True if std::unique_ptr is available
|
# HAVE_UNIQUE_PTR True if std::unique_ptr is available
|
||||||
# HAVE_NULLPTR True if nullptr is available
|
# HAVE_NULLPTR True if nullptr is available
|
||||||
|
# HAVE_REGEX True if std::regex available and sufficiently usable
|
||||||
# HAVE_ARRAY True if header <array> and fill() are available
|
# HAVE_ARRAY True if header <array> and fill() are available
|
||||||
# HAVE_ATTRIBUTE_ALWAYS_INLINE True if attribute always inline is supported
|
# HAVE_ATTRIBUTE_ALWAYS_INLINE True if attribute always inline is supported
|
||||||
# HAS_ATTRIBUTE_UNUSED True if attribute unused is supported
|
# HAS_ATTRIBUTE_UNUSED True if attribute unused is supported
|
||||||
@ -22,6 +23,9 @@
|
|||||||
# HAVE_TUPLE True if std::tuple is available
|
# HAVE_TUPLE True if std::tuple is available
|
||||||
# HAVE_TR1_TUPLE True if std::tr1::tuple is available
|
# HAVE_TR1_TUPLE True if std::tr1::tuple is available
|
||||||
|
|
||||||
|
include(CheckCXXSourceCompiles)
|
||||||
|
include(CheckCXXSourceRuns)
|
||||||
|
|
||||||
# test for C++11 flags
|
# test for C++11 flags
|
||||||
include(TestCXXAcceptsFlag)
|
include(TestCXXAcceptsFlag)
|
||||||
include(CheckIncludeFileCXX)
|
include(CheckIncludeFileCXX)
|
||||||
@ -124,6 +128,29 @@ CHECK_CXX_SOURCE_COMPILES("
|
|||||||
" HAVE_NULLPTR
|
" HAVE_NULLPTR
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# <regex>
|
||||||
|
CHECK_CXX_SOURCE_RUNS("
|
||||||
|
#include <regex>
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
std::regex r(\"AB.*|BC+\");
|
||||||
|
if (!std::regex_match(\"AB\", r))
|
||||||
|
return 1;
|
||||||
|
if (!std::regex_match(\"ABC\", r))
|
||||||
|
return 1;
|
||||||
|
if (!std::regex_match(\"ABC!#\", r))
|
||||||
|
return 1;
|
||||||
|
if (std::regex_match(\"B\", r))
|
||||||
|
return 1;
|
||||||
|
if (!std::regex_match(\"BC\", r))
|
||||||
|
return 1;
|
||||||
|
if (std::regex_match(\"BCE\", r))
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
" HAVE_REGEX
|
||||||
|
)
|
||||||
|
|
||||||
# constexpr
|
# constexpr
|
||||||
CHECK_CXX_SOURCE_COMPILES("
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
template <class T>
|
template <class T>
|
||||||
|
@ -160,7 +160,7 @@ find_package_handle_standard_args (opm-parser
|
|||||||
opm-parser_INCLUDE_DIRS opm-parser_LIBRARIES HAVE_OPM_PARSER
|
opm-parser_INCLUDE_DIRS opm-parser_LIBRARIES HAVE_OPM_PARSER
|
||||||
)
|
)
|
||||||
|
|
||||||
set (opm-parser_CONFIG_VARS "HAVE_OPM_PARSER")
|
set (opm-parser_CONFIG_VARS "HAVE_OPM_PARSER;HAVE_REGEX")
|
||||||
set (opm-parser_FOUND ${OPM-PARSER_FOUND})
|
set (opm-parser_FOUND ${OPM-PARSER_FOUND})
|
||||||
|
|
||||||
mark_as_advanced(opm-parser_LIBRARIES opm-parser_INCLUDE_DIRS OPM-PARSER_FOUND)
|
mark_as_advanced(opm-parser_LIBRARIES opm-parser_INCLUDE_DIRS OPM-PARSER_FOUND)
|
||||||
|
Loading…
Reference in New Issue
Block a user