macro(enable_cppcheck)
  find_program(CPPCHECK cppcheck)
  if(CPPCHECK)
    set(CMAKE_CXX_CPPCHECK ${CPPCHECK} --suppress=missingIncludeSystem --enable=warning,style,performance,portability,information --inconclusive --std=c++17 --quiet --inline-suppr)
  else()
    message(SEND_ERROR "cppcheck requested but executable not found")
  endif()
endmacro()

macro(enable_clangtidy)
  find_program(CLANGTIDY clang-tidy)
  if(CLANGTIDY)
    set(CMAKE_CXX_CLANG_TIDY ${CLANGTIDY})
  else()
    message(SEND_ERROR "clang-tidy requested but executable not found")
  endif()
endmacro()

macro(disable_cppcheck)
  set(CMAKE_CXX_CPPCHECK "")
endmacro()

macro(disable_clangtidy)
  set(CMAKE_CXX_CLANG_TIDY "")
endmacro()
