#
# $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()


SET(msg_messaging_gui_SRCS
  msg_messaging_gui_plugin.cpp
  msg_messaging_gui_plugin.h
  msg_messaging.cpp
  msg_messaging.h
  msg_messaging_model.cpp
  msg_messaging_model.h
  msg_show_message_dialog.cpp
  msg_show_message_dialog.h
  msg_new_message_dialog.cpp
  msg_new_message_dialog.h
)

NGL_WRAP_UI(msg_messaging_gui_SRCS
  msg_messaging.ui
  msg_show_message_dialog.ui
  msg_new_message_dialog.ui
)

NGL_ADD_LIBRARY(WS MsgMessageingGuiPlugin MODULE ${msg_messaging_gui_SRCS})
# msg_new_message_dialog.cpp includes LtsWidgets/ui_requirement.h (a handwritten header,
# not a UI file). Qt6's strict AUTOUIC auto-scan then demands a requirement.ui that does
# not exist and fails the autogen step. The real .ui files are wrapped explicitly above
# via NGL_WRAP_UI (qt6_wrap_ui), so disable the auto-scan (same approach as LtsWidgets).
set_target_properties(MsgMessageingGuiPlugin PROPERTIES AUTOUIC OFF)
if(QT6_GUI_AVAILABLE)
  NGL_TARGET_LINK_LIBRARIES(MsgMessageingGuiPlugin
    LtsPrinting
    NGLLogger
    LtsNotification
    LtsSession
    LtsSessionData
    LtsUtilsSettings
    MsgGuiPluginInterface
    MsgDataPluginInterface
    OpmGuiComboboxPluginInterface
    PpmDataPluginInterface
    TabocDataPluginInterface
    ${Qt6_Widgets}
    LtsWidgets
    LtsDataView
    LtsUtilsGuiDds
    ngltools
  )
endif()

NGL_INSTALL_TARGET(MsgMessageingGuiPlugin)
