cmake check_cxx_source_compiles(FAIL_REGEX) examples

doxygen/doxygen CMakeLists.txt :129

check_cxx_source_compiles(
  "
  #include <algorithm>

  #if !defined(__clang__) || !defined(_LIBCPP_VERSION)
  # error \"This is not clang with libcxx by llvm\"
  #endif

  int main() {
    return 0;
  }
  "
  IS_CLANG_LIBCPP
  FAIL_REGEX "This is not clang with libcxx by llvm"
)

OSGeo/gdal cmake/modules/CheckCXXCompilerFlag.cmake :90

CHECK_CXX_SOURCE_COMPILES("${_cxx_code}" ${_RESULT}
  # Some compilers do not fail with a bad flag
  FAIL_REGEX "command line option .* is valid for .* but not for C\\\\+\\\\+" # GNU
  ${_CheckCXXCompilerFlag_COMMON_PATTERNS}
  )