#
# $Id$
# $HeadURL$
# $Author$
#
# Created by Mike Wille, SLSE, 2017-04-27
#


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


ADD_INTERFACE_LIBRARY(
  TopicEditorInterface
  ${CMAKE_CURRENT_SOURCE_DIR}/topic_editor_interface.h
  ${CMAKE_CURRENT_SOURCE_DIR}/..
  Qt6::Core
)

# Library
SET(topic_editor_base_SRCS
  topic_editor_base.cpp
  topic_editor_base.h
  topic_editor_utils.cpp
  topic_editor_utils.h
  topic_preview_widget.cpp
  topic_preview_widget.h
  topic_previewer.cpp
  topic_previewer.h
)

NGL_WRAP_UI(topic_editor_base_SRCS
  topic_preview_widget.ui
)

IF(BUILD_RTI)
NGL_ADD_LIBRARY2(WS TopicEditorBase SHARED ${topic_editor_base_SRCS})

NGL_TARGET_INCLUDE_DIRECTORIES(TopicEditorBase
  PUBLIC
    ${CMAKE_CURRENT_SOURCE_DIR}/../
    ${CMAKE_CURRENT_BINARY_DIR} # topiceditorbase_export.h (generated here)
    ${CMAKE_CURRENT_BINARY_DIR}/../ # auto-export file
    ${CMAKE_BINARY_DIR}/Z/src/NGLLogger # ngllogger_export.h
)

if(QT6_GUI_AVAILABLE)
  NGL_TARGET_LINK_LIBRARIES(TopicEditorBase
    LtsScriptTimeline
    ${Qt6_Widgets}
    Qt6::Core
    LtsWidgets
    LtsUtilsCore
  )
endif()
ENDIF(BUILD_RTI)
