option(MELT_ENABLE_CPPCHECK "Enable static analysis with cppcheck" OFF)
if(MELT_ENABLE_CPPCHECK)
  find_program(CPPCHECK cppcheck)
  if(CPPCHECK)
    set(CMAKE_CXX_CPPCHECK ${CPPCHECK} --suppress=missingInclude --enable=all
                           --inconclusive -i ${CMAKE_SOURCE_DIR}/imgui/lib)
  else()
    message(SEND_ERROR "cppcheck requested but executable not found")
  endif()
endif()

option(MELT_ENABLE_CLANG_TIDY "Enable static analysis with clang-tidy" OFF)
if(MELT_ENABLE_CLANG_TIDY)
  find_program(CLANGTIDY NAMES clang-tidy clang-tidy-11 clang-tidy-10 clang-tidy-9)
  if(CLANGTIDY)
    set(CMAKE_CXX_CLANG_TIDY ${CLANGTIDY})
  else()
    message(SEND_ERROR "clang-tidy requested but executable not found")
  endif()
endif()
