#
# $Id$
# $HeadURL$
# $Author$
# Created by Hannes Baeuerle, SLSE, 2017-02-24
#

# Make ${Qt6_Widgets} optional
if(QT6_GUI_AVAILABLE AND TARGET Qt6::Widgets)
  set(Qt6_Widgets ${Qt6_Widgets})
else()
  set(Qt6_Widgets "")
endif()


FIND_PACKAGE(KDChart)
IF (NOT KDChart_FOUND)
  MESSAGE(WARNING "KDChart not found; skipping OnlineReports")
  RETURN()
ENDIF()

SET(ore_online_reports_gui_SRCS
  ore_online_reports_gui_plugin.h
  ore_online_reports_gui_plugin.cpp
  ore_create_report_dialog.h
  ore_create_report_dialog.cpp
  ore_report_dialog.h
  ore_report_dialog.cpp
  ore_type_model.h
  ore_type_model.cpp

  Charts/ore_abstract_chart_model.h
  Charts/ore_abstract_chart_model.cpp
  Charts/ore_detailed_chart_model.h
  Charts/ore_detailed_chart_model.cpp
  Charts/ore_simple_chart_model.h
  Charts/ore_simple_chart_model.cpp
)

NGL_WRAP_UI (ore_online_reports_gui_SRCS
  ore_create_report_dialog.ui
  ore_report_dialog.ui
)

NGL_ADD_LIBRARY(WS OreOnlineReportsGuiPlugin MODULE ${ore_online_reports_gui_SRCS})

if(QT6_GUI_AVAILABLE)
  NGL_TARGET_LINK_LIBRARIES(OreOnlineReportsGuiPlugin
    AsbDataPluginInterface
    LtsSession
    OreOnlineReportsGuiPluginInterface
    svcOreDummy
    GuiPluginInterface
    ${Qt6_Widgets}
    PpmCommon
    KDChart::KDChart
    LtsUtilsSettings
  )
endif()

NGL_INSTALL_TARGET(OreOnlineReportsGuiPlugin)
