# SPDX-FileCopyrightText: (C) 2024 Deskflow Developers
# SPDX-FileCopyrightText: (C) 2024 Symless Ltd
# SPDX-License-Identifier: MIT

set(target gui)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

if(APPLE)
  set (platform_sources
    OSXHelpers.h
    OSXHelpers.mm
  )
endif()

add_library(${target} STATIC
  ${platform_sources}
  Action.cpp
  Action.h
  Diagnostic.cpp
  Diagnostic.h
  FileTail.cpp
  FileTail.h
  Hotkey.cpp
  Hotkey.h
  KeySequence.cpp
  KeySequence.h
  Logger.cpp
  Logger.h
  MainWindow.cpp
  MainWindow.h
  MainWindow.ui
  Messages.cpp
  Messages.h
  ScreenSetupModel.cpp
  ScreenSetupModel.h
  StyleUtils.h
  TlsUtility.cpp
  TlsUtility.h
  VersionChecker.cpp
  VersionChecker.h
  config/IServerConfig.h
  config/Screen.cpp
  config/Screen.h
  config/ScreenConfig.cpp
  config/ScreenConfig.h
  config/ScreenList.cpp
  config/ScreenList.h
  config/ServerConfig.cpp
  config/ServerConfig.h
  core/ClientConnection.cpp
  core/ClientConnection.h
  core/CoreProcess.cpp
  core/CoreProcess.h
  core/NetworkMonitor.cpp
  core/NetworkMonitor.h
  core/ServerConnection.cpp
  core/ServerConnection.h
  core/ServerMessage.cpp
  core/ServerMessage.h
  core/WaylandWarnings.cpp
  core/WaylandWarnings.h
  dialogs/AboutDialog.cpp
  dialogs/AboutDialog.h
  dialogs/AboutDialog.ui
  dialogs/ActionDialog.cpp
  dialogs/ActionDialog.h
  dialogs/ActionDialog.ui
  dialogs/ClientConfigDialog.h
  dialogs/ClientConfigDialog.cpp
  dialogs/ClientConfigDialog.ui
  dialogs/FingerprintDialog.cpp
  dialogs/FingerprintDialog.h
  dialogs/HotkeyDialog.cpp
  dialogs/HotkeyDialog.h
  dialogs/HotkeyDialog.ui
  dialogs/ScreenSettingsDialog.cpp
  dialogs/ScreenSettingsDialog.h
  dialogs/ScreenSettingsDialog.ui
  dialogs/ServerConfigDialog.cpp
  dialogs/ServerConfigDialog.h
  dialogs/ServerConfigDialog.ui
  dialogs/SettingsDialog.cpp
  dialogs/SettingsDialog.h
  dialogs/SettingsDialog.ui
  ipc/DaemonIpcClient.cpp
  ipc/DaemonIpcClient.h
  validators/AliasValidator.cpp
  validators/AliasValidator.h
  validators/ComputerNameValidator.cpp
  validators/ComputerNameValidator.h
  validators/EmptyStringValidator.cpp
  validators/EmptyStringValidator.h
  validators/IStringValidator.cpp
  validators/IStringValidator.h
  validators/LineEditValidator.cpp
  validators/LineEditValidator.h
  validators/ScreenDuplicationsValidator.cpp
  validators/ScreenDuplicationsValidator.h
  validators/ScreenNameValidator.cpp
  validators/ScreenNameValidator.h
  validators/SpacesValidator.cpp
  validators/SpacesValidator.h
  validators/ValidationError.cpp
  validators/ValidationError.h
  validators/IpAddressValidator.cpp
  validators/IpAddressValidator.h
  widgets/FingerprintPreview.cpp
  widgets/FingerprintPreview.h
  widgets/KeySequenceWidget.cpp
  widgets/KeySequenceWidget.h
  widgets/LogDock.cpp
  widgets/LogDock.h
  widgets/LogWidget.h
  widgets/LogWidget.cpp
  widgets/NewScreenWidget.cpp
  widgets/NewScreenWidget.h
  widgets/ScreenSetupView.cpp
  widgets/ScreenSetupView.h
  widgets/SearchWidget.h
  widgets/SearchWidget.cpp
  widgets/TrashScreenWidget.cpp
  widgets/TrashScreenWidget.h
)

target_link_libraries(
  ${target}
  common
  platform
  Qt6::Core
  Qt6::Widgets
  Qt6::Network)

if(WIN32)
  target_link_libraries(
    ${target}
    base
    arch
    net
  )
endif()
