#
# $Id$
# $HeadURL$
# $Author$
# Created by Patric Karwat, SLSE, 2016-10-05
#

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


FIND_PACKAGE(KDReports)
FIND_PACKAGE(KDChart)
IF ((NOT KDReports_FOUND OR NOT KDChart_FOUND) OR NOT BUILD_CODIFICATION)
  MESSAGE(WARNING "KDReports, KDChart not found or BUILD_CODIFICATION disabled; skipping ReportViewer")
  RETURN()
ENDIF()

SET(rep_report_viewer_gui_SRCS
  rep_report_viewer_gui_plugin.cpp
  rep_report_viewer_gui_plugin.h
  rep_report_list.cpp
  rep_report_list.h
  rep_report_model.cpp
  rep_report_model.h
  rep_report_edit.cpp
  rep_report_edit.h
  rep_report_preview.cpp
  rep_report_preview.h
  rep_report_interval.cpp
  rep_report_interval.h
  rep_report_interval_model.cpp
  rep_report_interval_model.h
  CustomView/rep_entry.h
  CustomView/rep_entry.cpp
  Input/rep_input_aes_model.cpp
  Input/rep_input_aes_model.h
  Input/rep_input_type_model.cpp
  Input/rep_input_type_model.h
  Input/rep_input_charge_model.cpp
  Input/rep_input_charge_model.h
  Input/rep_input_building_model.cpp
  Input/rep_input_building_model.h
  Input/rep_input_sanitation_material_model.cpp
  Input/rep_input_sanitation_material_model.h
  Models/rep_abstract_model.h
  Models/rep_abstract_model.cpp
  Models/rep_unit_power_model.h
  Models/rep_unit_power_model.cpp
  Models/rep_participant_distance_model.h
  Models/rep_participant_distance_model.cpp
  Models/rep_charge_administration_model.h
  Models/rep_charge_administration_model.cpp
  Models/rep_charge_resupply_model.h
  Models/rep_charge_resupply_model.cpp
  Models/rep_firings_model.h
  Models/rep_firings_model.cpp
  Models/rep_air_support_model.h
  Models/rep_air_support_model.cpp
  Models/rep_mine_area_model.h
  Models/rep_mine_area_model.cpp
  Models/rep_nbc_model.h
  Models/rep_nbc_model.cpp
  Models/rep_maintenance_model.h
  Models/rep_maintenance_model.cpp
  Models/rep_building_damage_model.h
  Models/rep_building_damage_model.cpp
  Models/rep_sanitation_material_model.h
  Models/rep_sanitation_material_model.cpp
  Models/rep_medevac_nine_liner_model.h
  Models/rep_medevac_nine_liner_model.cpp
  Models/rep_treatment_model.h
  Models/rep_treatment_model.cpp
  Models/rep_treatment_timeline_model.h
  Models/rep_treatment_timeline_model.cpp
  ./TopicEditor/topic_editor.h
  ./TopicEditor/topic_editor.cpp
)

NGL_WRAP_UI(rep_report_viewer_gui_SRCS
  rep_report_list.ui
  rep_report_interval.ui
  rep_report_edit.ui
  rep_report_preview.ui
  CustomView/rep_entry.ui
  ./TopicEditor/topic_editor.ui
)

NGL_ADD_LIBRARY(WS RepReportViewerGuiPlugin MODULE ${rep_report_viewer_gui_SRCS})
if(QT6_GUI_AVAILABLE)
  NGL_TARGET_LINK_LIBRARIES(RepReportViewerGuiPlugin
    AsbDataPluginInterface
    ${Qt6_Widgets}
    KDReports::KDReports
    KDChart::KDChart
    NGLLogger
    ngltools
    nglsettings
    ngltranslator
    LtsPrinting
    LtsSession
    LtsSessionData
    LtsWidgets
    LtsReportDisplay
    LtsDataView
    LtsUtilsGuiDds
    ltsCoordWidget
    LtsCoordTrans
    RepGuiPluginInterface
    RepDataPluginInterface
    PpmDataPluginInterface
    OpmDataPluginInterface
    AesDataPluginInterface
    ExmDataPluginInterface
    PdmDataPluginInterface
    FlmDataPluginInterface
    EvlDataPluginInterface
    PdmChargeTableGui
    PpmGuiParticipantsPluginInterface
    PpmGuiComboboxPluginInterface
    PpmCommon
    IsmDataPluginInterface
    TopicEditorBase
    LtsScriptTimeline
    LtsUtilsSettings
  )
endif()

NGL_INSTALL_TARGET(RepReportViewerGuiPlugin)
