#
# $Id$
# $HeadURL$
# $Author$
#
# Created by Malte Diers, SLSE, 2017-02-13
#

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


SET(aes_base_gui_SRCS
  aes_base_edit.cpp
  aes_base_edit.h
  aes_base_gui_plugin.cpp
  aes_base_gui_plugin.h
  aes_base_model.cpp
  aes_base_model.h
  aes_base_exports.h
  aes_itemlist.cpp
  aes_itemlist.h
  aes_pixmap_label.cpp
  aes_pixmap_label.h
  InfoView/aes_base_info.cpp
  InfoView/aes_base_info.h
)

NGL_WRAP_UI(aes_base_gui_SRCS
  aes_itemlist.ui
  InfoView/aes_base_info.ui
)

NGL_ADD_LIBRARY2(WS AesBaseGui SHARED ${aes_base_gui_SRCS})
# aes_base_edit.h 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(AesBaseGui PROPERTIES AUTOUIC OFF)
NGL_TARGET_INCLUDE_DIRECTORIES(AesBaseGui
  PUBLIC
    ${CMAKE_CURRENT_SOURCE_DIR}/../../../Services/
)
if(QT6_GUI_AVAILABLE)
  NGL_TARGET_LINK_LIBRARIES(AesBaseGui
    PRIVATE
      ExmDataPluginInterface
      LtsPrinting
      ngltools
      PpmGuiComboboxPluginInterface
      SituationMapGuiPluginInterface
      svcAesCommon
    PUBLIC
      PdmDataPluginInterface
      PdmGuiPluginInterface
      LtsCoordTrans   # because it's used by every lib which links against AesBaseGui
      ltsCoordWidget  # because it's used by every lib which links against AesBaseGui
      LtsDataView     # because it's used by every lib which links against AesBaseGui
      LtsSession
      LtsSessionData
      LtsUtilsGuiDds
      LtsWidgets
      ${Qt6_Widgets}
  )
endif()

NGL_INSTALL_TARGET(AesBaseGui)
