#
# CMakeLists.txt for LtsTimeline, the base for EventTimeline and ScriptTimeline aka. Script Editor
#
# $Id: CMakeLists.txt 39615 2018-03-16 13:36:41Z wille_m $
# $HeadURL: svn://192.168.133.21/TDS/branches/product/features/hotline/Lts/Common/LtsEventTimeline/CMakeLists.txt $
# $Author: wille_m $
#
# Created by Mike Wille, SLTE, 2021-05-18
#

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

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


SET(src
  timeline_model.h
  timeline_model.cpp

  item.h
  item.cpp
  item_delegate.h
  item_delegate.cpp

  timeline_header_view.cpp
  timeline_header_view.h
  timeline_header_view_mouse_handler.cpp
  timeline_header_view_mouse_handler.h
  timeline_utils.cpp
  timeline_utils.h
  timeline_view.h
  timeline_view.cpp
  timeline_view_drag_handler.cpp
  timeline_view_drag_handler.h
  timeline_view_resize_handler.cpp
  timeline_view_resize_handler.h
  timeline_view_selection_handler.cpp
  timeline_view_selection_handler.h
  timeline_view_track_handler.cpp
  timeline_view_track_handler.h
  timeline_widget.h
  timeline_widget.cpp

  track.h
  track.cpp
)

SET(uisrc
  timeline_widget.ui
)

NGL_WRAP_UI(src ${uisrc})
NGL_ADD_LIBRARY2(WS LtsTimeline SHARED ${src})
NGL_TARGET_INCLUDE_DIRECTORIES(LtsTimeline
  PUBLIC
    ${CMAKE_CURRENT_SOURCE_DIR}/../
    ${CMAKE_CURRENT_BINARY_DIR}
)
if(QT6_GUI_AVAILABLE)
  NGL_TARGET_LINK_LIBRARIES(LtsTimeline
    PRIVATE
      NGLLogger
      ngltools # DTG
      LtsWidgets # LtsMessageDialogNew for remove filter track
      Qt6::Core
      ${Qt6_Gui}
      ${Qt6_Widgets}
  )
endif()
NGL_INSTALL_TARGET(LtsTimeline)


# LtsTimelineTest
NGL_ADD_EXECUTABLE(WS LtsTimelineTest main.cpp)
if(QT6_GUI_AVAILABLE)
  NGL_TARGET_LINK_LIBRARIES(LtsTimelineTest
    LtsTimeline
    nglapplication
    NGLLogger
    Qt6::Core
    ${Qt6_Gui}
    ${Qt6_Widgets}
  )
endif()
