if(DEFINED ENV{ENABLE_STAT})
  option(WFC_ENABLE_STAT "Enable statistics components" ON)
else()
  option(WFC_ENABLE_STAT "Enable statistics components" OFF)
endif()

MACRO(enable_stat)
  if ( WFC_ENABLE_STAT )
    foreach(arg IN ITEMS ${ARGN})
      message(STATUS "Enable statistics for ${arg}")
      target_compile_definitions(${arg} PUBLIC WFC_ENABLE_STAT=ON)
    endforeach()
  endif()
ENDMACRO(enable_stat)

MACRO(disable_stat)
  if ( WFC_ENABLE_STAT )
    foreach(arg IN ITEMS ${ARGN})
      message(STATUS "Disable statistics for ${arg}")
      target_compile_definitions(${arg} PUBLIC WFC_ENABLE_STAT=OFF)
    endforeach()
  endif()
ENDMACRO(disable_stat)
