cmake HAVE_REGEX examples

monkey/monkey CMakeLists.txt :218

check_c_source_compiles("
  #include <regex.h>
  int main() {
     regex_t reg;
     const char str[] = \"[a-zA-Z0-9]*\";
     ret = regcomp(&reg, str, REG_EXTENDED|REG_ICASE|REG_NOSUB);
     return 0;
  }" HAVE_REGEX)

fluent/fluent-bit lib/librdkafka-2.10.1/packaging/cmake/try_compile/rdkafka_setup.cmake :1

try_compile(
    HAVE_REGEX
    "${CMAKE_CURRENT_BINARY_DIR}/try_compile"
    "${TRYCOMPILE_SRC_DIR}/regex_test.c"
)

fluent/fluent-bit lib/monkey/CMakeLists.txt :218

check_c_source_compiles("
  #include <regex.h>
  int main() {
     regex_t reg;
     const char str[] = \"[a-zA-Z0-9]*\";
     ret = regcomp(&reg, str, REG_EXTENDED|REG_ICASE|REG_NOSUB);
     return 0;
  }" HAVE_REGEX)

libcheck/check CMakeLists.txt :241

add_definitions(-DHAVE_REGEX=1)