set( CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 1000 )
set( CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 1000 )

##------------------------------------------------------------------------------
## Ignore warnings in generated code during the build process
list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
  # For *NIX builds, MOAB does not generate export headers. Instead, it builds
  # its libraries with default (i.e. public) visibility. SMTK builds with hidden
  # visibility, so on MacOS we get warnings that match the following pattern
  # where SMTK directly access symbols from the MOAB library. As of 03/19/2019,
  # there is no plan to add symbol exporting to MOAB. Thus, we ignore these
  # warnings.
  #
  # There is also an instance from a protected class in smtkQtExt.
  "warning: direct access in function .* to global weak symbol 'typeinfo "

  # Generated VTK python wrappings.
  ".*Python.cxx.*warning.*static member accessed through instance.*"

  # Clang-Tidy won't ignore this correctly
  "warning.*operator=().*should return 'OrderedArcs.'"

  # Ignore warnings from CMake autogen code
  "autogen"

  # Fixes from paraview/paraview!5322
  "_server_manager\\.h.*misc-definitions-in-headers"
  "_server_manager_modules\\.h.*misc-definitions-in-headers"
  "note: make as 'inline'"

  # Warnings from the delaunay submodule.
  "thirdparty/delaunay"

  # Warnings from pugi.
  "thirdparty/pugixml/src"

  # Warnings from sccache that we don't care about.
  "sccache: warning: The server looks like it shut down unexpectedly, compiling locally instead"

  # LTO serial compilation warnings
  "lto-wrapper: warning: using serial compilation of [0-9]+ LTRANS jobs"
)

##------------------------------------------------------------------------------
## Regular expression for error exceptions during build process
#set (CTEST_CUSTOM_ERROR_EXCEPTION
#  ${CTEST_CUSTOM_ERROR_EXCEPTION}
#)

cmake_policy(SET CMP0012 NEW)

if(@SMTK_COVERAGE_ENABLED@)
  set(COVERAGE_EXTRA_FLAGS "-l -p")
  set(CTEST_CUSTOM_COVERAGE_EXCLUDE
    "thirdparty"
    "testing"
    "pybind11"
    "qt"
    "autogen"
    "CMakeFiles"

    # ParaView-generated sources.
    "plugin/.*Plugin\\.h"
    )
endif()
