#
# $Id$
# $HeadURL$
# $Author$
# Created by Mike Wille, SLSE, 2016-05-20
#


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


NGL_ADD_LIBRARY2(ALL LtsPluginLoader SHARED lts_plugin_loader.cpp lts_plugin_loader.h)
NGL_TARGET_INCLUDE_DIRECTORIES(LtsPluginLoader
  PUBLIC
    ${CMAKE_CURRENT_SOURCE_DIR}/../
)

NGL_TARGET_LINK_LIBRARIES(LtsPluginLoader
  PRIVATE
    NGLLogger
  PUBLIC
    Qt6::Core
)

# LtsPluginManager
SET(ltspluginmanager_SRCS
  lts_plugin_manager.h
  lts_plugin_manager.cpp
  Ui/lts_plugin_manager_dialog.h
  Ui/lts_plugin_manager_dialog.cpp
  Ui/lts_plugin_manager_widget.h
  Ui/lts_plugin_manager_widget.cpp

  lts_plugin_manager_export.h
)

NGL_WRAP_UI(ltspluginmanager_SRCS
  Ui/lts_plugin_manager_dialog.ui
  Ui/lts_plugin_manager_widget.ui
)

IF(BUILD_RTI)
NGL_ADD_LIBRARY2(WS LtsPluginManager SHARED ${ltspluginmanager_SRCS})

NGL_TARGET_INCLUDE_DIRECTORIES(LtsPluginManager
  PUBLIC
    ${CMAKE_CURRENT_SOURCE_DIR}/../
)

if(QT6_GUI_AVAILABLE)
  NGL_TARGET_LINK_LIBRARIES(LtsPluginManager
    PRIVATE
      NGLLogger
      LtsPluginLoader
      GuiPluginInterface
      DataPluginInterface
      LtsWidgets
      LtsSession
      LtsSessionData
      ${Qt6_Widgets}
    PUBLIC
      ProjectConfig
      LtsAppDescriptor
      Qt6::Core
  )
endif()

NGL_INSTALL_TARGET(LtsPluginManager)
ENDIF(BUILD_RTI)

NGL_INSTALL_TARGET(LtsPluginLoader)
