if (CMAKE_BUILD_TYPE STREQUAL "Coverage")
  message(----------Enable Coverage----------)
  set(CMAKE_BUILD_TYPE "Debug")
  include(CodeCoverage)
  SET(CMAKE_CXX_FLAGS "-g -O0 --coverage -fno-exceptions -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-inline")
  SET(CMAKE_C_FLAGS "-g -O0 --coverage -fno-exceptions -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-inline")
  if (use-gcovr)
    message("using gcovr-html")
    function (setup_target_for_coverage)
      setup_target_for_coverage_gcovr_html( ${ARGV} )
    endfunction()
  else()
    message("using lcov")
    function (setup_target_for_coverage)
      setup_target_for_coverage_lcov( ${ARGV} )
    endfunction()
  endif()
else()
  function (setup_target_for_coverage)
  endfunction()
endif() #CMAKE_BUILD_TYPE STREQUAL "Coverage"
