MACRO (MACRO_KT_PLUGIN _option _name _dir)
option(${_option} "Whether to build the ${_name} plugin or not" true)
if (${_option})
  message(STATUS "Building ${_name} plugin (-D${_option}=false to disable)")
  add_subdirectory(${_dir})
else (${_option})
  message(STATUS "Not building ${_name} plugin (-D${_option}=true to enable)")
endif (${_option})
ENDMACRO (MACRO_KT_PLUGIN)
find_package(Taglib)
macro_kt_plugin(ENABLE_LOGVIEWER_PLUGIN logviewer logviewer)
macro_kt_plugin(ENABLE_INFOWIDGET_PLUGIN infowidget infowidget)
macro_kt_plugin(ENABLE_UPNP_PLUGIN upnp upnp)
macro_kt_plugin(ENABLE_SEARCH_PLUGIN search search)
macro_kt_plugin(ENABLE_WEBINTERFACE_PLUGIN webinterface webinterface)
macro_kt_plugin(ENABLE_SCANFOLDER_PLUGIN scanfolder scanfolder)
macro_kt_plugin(ENABLE_IPFILTER_PLUGIN ipfilter ipfilter)
macro_kt_plugin(ENABLE_STATS_PLUGIN stats stats)
macro_kt_plugin(ENABLE_BWSCHEDULER_PLUGIN bwscheduler bwscheduler)
if (TAGLIB_FOUND)
  macro_kt_plugin(ENABLE_MEDIAPLAYER_PLUGIN mediaplayer mediaplayer)
endif(TAGLIB_FOUND)  
macro_kt_plugin(ENABLE_SCRIPTING_PLUGIN scripting scripting)
macro_kt_plugin(ENABLE_SYNDICATION_PLUGIN syndication syndication)
macro_kt_plugin(ENABLE_DOWNLOADORDER_PLUGIN downloadorder downloadorder)
macro_kt_plugin(ENABLE_SHUTDOWN_PLUGIN shutdown shutdown)
macro_kt_plugin(ENABLE_ZEROCONF_PLUGIN zeroconf zeroconf)
