# let's put most of the "meat" in a static library this way, we can also unit
# test parts of it
add_library(gpgpass_internal STATIC)

target_sources(
  gpgpass_internal
  PRIVATE
          clipboardhelper.h
          configdialog.h
          deselectabletreeview.h
          firsttimedialog.h
          gpgmehelpers.h
          mainwindow.h
          passentry.h
          passwordconfiguration.h
          passworddialog.h
          passwordgenerator.h
          passwordviewer.h
          qpushbuttonfactory.h
          settings.h
          userinfo.h
          usersdialog.h
          util.h
          welcomewidget.h
          clipboardhelper.cpp
          configdialog.cpp
          firsttimedialog.cpp
          mainwindow.cpp
          passentry.cpp
          passworddialog.cpp
          passwordgenerator.cpp
          passwordviewer.cpp
          settings.cpp
          usersdialog.cpp
          util.cpp
          welcomewidget.cpp
          ../resources.qrc

          job/directoryreencryptjob.cpp
          job/directoryreencryptjob.h
          job/fileencryptjob.cpp
          job/fileencryptjob.h
          job/filedecryptjob.cpp
          job/filedecryptjob.h
          job/filereencryptjob.cpp
          job/filereencryptjob.h

          models/addfileinfoproxy.cpp
          models/addfileinfoproxy.h
          models/storemodel.cpp
          models/storemodel.h
          models/userslistmodel.cpp
          models/userslistmodel.h
	  )

ki18n_wrap_ui(gpgpass_internal
          mainwindow.ui
          configdialog.ui
          usersdialog.ui
          passworddialog.ui
          userswidget.ui
          welcomewidget.ui
	  )

target_link_libraries(gpgpass_internal
    Qt::Widgets
    KF${QT_MAJOR_VERSION}::CoreAddons
    KF${QT_MAJOR_VERSION}::Prison
    KF${QT_MAJOR_VERSION}::IconThemes
    KF${QT_MAJOR_VERSION}::I18n
    KF${QT_MAJOR_VERSION}::WidgetsAddons
    KF${QT_MAJOR_VERSION}::ItemModels
    KPim${QT_MAJOR_VERSION}::Libkleo
)

if (QT_MAJOR_VERSION STREQUAL "6")
    target_link_libraries(gpgpass_internal QGpgmeQt6)
else()
    target_link_libraries(gpgpass_internal QGpgme)
endif()
