Warning, /network/kget/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
0002 
0003 # KDE Application Version, managed by release script
0004 set(RELEASE_SERVICE_VERSION_MAJOR "23")
0005 set(RELEASE_SERVICE_VERSION_MINOR "04")
0006 set(RELEASE_SERVICE_VERSION_MICRO "1")
0007 set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
0008 
0009 project(kget VERSION ${RELEASE_SERVICE_VERSION})
0010 
0011 set(REQUIRED_QT_VERSION "5.15.0")
0012 set(KF5_VERSION "5.91.0")
0013 set(KDE_COMPILERSETTINGS_LEVEL "5.82")
0014 
0015 find_package(ECM ${KF5_VERSION} REQUIRED NO_MODULE)
0016 
0017 set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})
0018 
0019 include(KDEInstallDirs)
0020 include(KDECMakeSettings)
0021 include(KDECompilerSettings NO_POLICY_SCOPE)
0022 
0023 include(ECMAddAppIcon)
0024 include(ECMInstallIcons)
0025 include(ECMAddTests)
0026 include(ECMQtDeclareLoggingCategory)
0027 include(ECMSetupVersion)
0028 include(ECMSetupQtPluginMacroNames)
0029 include(GenerateExportHeader)
0030 include(KDEClangFormat)
0031 include(KDEGitCommitHooks)
0032 
0033 find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} REQUIRED CONFIG COMPONENTS
0034     DBus
0035     Gui
0036     Network
0037     Sql
0038     Test
0039     Widgets
0040     Xml
0041 )
0042 
0043 find_package(KF5 ${KF5_VERSION} REQUIRED
0044     Completion
0045     Config
0046     ConfigWidgets
0047     CoreAddons
0048     Crash
0049     DBusAddons
0050     DocTools
0051     I18n
0052     IconThemes
0053     ItemViews
0054     KCMUtils
0055     KIO
0056     Notifications
0057     NotifyConfig
0058     Parts
0059     TextWidgets
0060     Wallet
0061     WidgetsAddons
0062     WindowSystem
0063     XmlGui
0064 )
0065 
0066 #include(CheckIncludeFile)
0067 #include(CheckIncludeFiles)
0068 #include(CheckSymbolExists)
0069 #include(CheckFunctionExists)
0070 #include(CheckLibraryExists)
0071 #include(CheckPrototypeExists)
0072 #include(CheckTypeSize)
0073 
0074 if(WIN32)
0075    set(CMAKE_REQUIRED_LIBRARIES ${KDEWIN32_LIBRARIES})
0076    set(CMAKE_REQUIRED_INCLUDES  ${KDEWIN32_INCLUDES})
0077 endif()
0078 
0079 find_package(SQLite3)
0080 set_package_properties(SQLite3 PROPERTIES
0081     DESCRIPTION "SQLite is a Binary-Database"
0082     TYPE RECOMMENDED
0083     PURPOSE "Needed for the SQLite-Backend of the KGet-History"
0084 )
0085 
0086 find_package(Qca-qt${QT_MAJOR_VERSION} 2.1.0)
0087 set_package_properties(Qca-qt${QT_MAJOR_VERSION} PROPERTIES
0088     DESCRIPTION "Support for encryption"
0089     URL "https://download.kde.org/stable/qca-qt5/"
0090     TYPE REQUIRED
0091 )
0092 
0093 find_package(Gpgmepp 1.7.0)
0094 set_package_properties(Gpgmepp PROPERTIES
0095     DESCRIPTION "The GpgME++ library"
0096     URL "https://www.gnupg.org"
0097     TYPE RECOMMENDED
0098     PURPOSE "GpgME++ is required to have signature verifying support in KGet."
0099 )
0100 
0101 find_package(KF5Torrent 21.07.70)
0102 set_package_properties(KF5Torrent PROPERTIES
0103     DESCRIPTION "Backend Library of KTorrent"
0104     TYPE RECOMMENDED
0105     PURPOSE "Needed to build KGet bittorrent support."
0106 )
0107 
0108 find_package(LibMms)
0109 set_package_properties(LibMms PROPERTIES
0110     DESCRIPTION "Library to read mms streams"
0111     TYPE RECOMMENDED
0112     PURPOSE "Needed to build KGet mms support."
0113 )
0114 
0115 if(CMAKE_BUILD_TYPE MATCHES debugfull)
0116      add_definitions(-DDEBUG)
0117 endif()
0118 
0119 if (Qca-qt${QT_MAJOR_VERSION}_FOUND)
0120     add_definitions(-DHAVE_QCA2)
0121 MESSAGE(STATUS "QCA found")
0122 endif()
0123 
0124 find_package(Boost REQUIRED)
0125 
0126 if(Gpgmepp_FOUND)
0127     if (QT_MAJOR_VERSION STREQUAL "6")
0128         find_package(QGpgmeQt6 ${GPGME_REQUIRED_VERSION} CONFIG REQUIRED)
0129     else()
0130         find_package(QGpgme ${GPGME_REQUIRED_VERSION} CONFIG REQUIRED)
0131     endif()
0132     add_definitions(-DHAVE_QGPGME)
0133 endif()
0134 
0135 set (KGET_PLUGIN_INSTALL_DIR ${KDE_INSTALL_PLUGINDIR}/kget)
0136 
0137 add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
0138 
0139 include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
0140 
0141 ecm_setup_version(PROJECT
0142     VARIABLE_PREFIX KGET
0143     VERSION_HEADER "kget_version.h"
0144 )
0145 
0146 ecm_setup_qtplugin_macro_names(JSON_NONE KGET_EXPORT_PLUGIN KGET_EXPORT_PLUGIN_CONFIG)
0147 
0148 add_subdirectory(conf)
0149 add_subdirectory(core)
0150 add_subdirectory(ui)
0151 add_subdirectory(transfer-plugins)
0152 add_subdirectory(sounds)
0153 add_subdirectory(desktop)
0154 add_subdirectory(tests)
0155 add_subdirectory(doc)
0156 
0157 find_package(LibKWorkspace CONFIG)
0158 set_package_properties(LibKWorkspace PROPERTIES
0159     TYPE OPTIONAL
0160     PURPOSE "Allows 'shutdown after downloads completed' in kget"
0161 )
0162 if(LibKWorkspace_FOUND)
0163     add_definitions(-DHAVE_KWORKSPACE)
0164 endif()
0165 
0166 include_directories(
0167     ${CMAKE_CURRENT_SOURCE_DIR}/core/
0168     ${CMAKE_CURRENT_BINARY_DIR}/core/
0169 )
0170 
0171 if(SQLite3_FOUND)
0172     add_definitions(-DHAVE_SQLITE)
0173 endif()
0174 
0175 remove_definitions(-DQT_NO_HTTP)
0176 
0177 # kgetcore
0178 
0179 add_library(kgetcore SHARED)
0180 set_target_properties(kgetcore PROPERTIES
0181     VERSION 5.0.0
0182     SOVERSION 5
0183 )
0184 
0185 set(kgetcore_dbus_SRCS)
0186 qt_add_dbus_adaptor(kgetcore_dbus_SRCS dbus/org.kde.kget.transfer.xml dbus/dbustransferwrapper.h DBusTransferWrapper)
0187 qt_add_dbus_adaptor(kgetcore_dbus_SRCS dbus/org.kde.kget.verifier.xml dbus/dbusverifierwrapper.h DBusVerifierWrapper)
0188 
0189 target_sources(kgetcore PRIVATE
0190     ${kgetcore_dbus_SRCS}
0191     core/job.cpp
0192     core/jobqueue.cpp
0193     core/kget.cpp
0194     core/scheduler.cpp
0195     core/transfertreemodel.cpp
0196     core/transfertreeselectionmodel.cpp
0197     core/transfer.cpp
0198     core/transfergroup.cpp
0199     core/transfergrouphandler.cpp
0200     core/transferhandler.cpp
0201     core/handler.cpp
0202     core/transfergroupscheduler.cpp
0203     core/plugin/plugin.cpp
0204     core/plugin/transferfactory.cpp
0205     core/transferdatasource.cpp
0206     core/datasourcefactory.cpp
0207     core/kgetkjobadapter.cpp
0208     core/kuiserverjobs.cpp
0209     core/kgetglobaljob.cpp
0210     core/bitset.cpp
0211     core/download.cpp
0212     core/transferhistorystore.cpp
0213     core/transferhistorystore_xml.cpp
0214     core/transferhistorystore_sqlite.cpp
0215     core/linkimporter.cpp
0216     dbus/dbustransferwrapper.cpp
0217     dbus/dbusverifierwrapper.cpp
0218     core/filemodel.cpp
0219     core/verifier.cpp
0220     core/verificationthread.cpp
0221     core/verificationmodel.cpp
0222     core/verificationdelegate.cpp
0223     core/signature.cpp
0224     core/signaturethread.cpp
0225     core/keydownloader.cpp
0226     core/urlchecker.cpp
0227     core/basedialog.cpp
0228     core/mostlocalurl.cpp
0229     core/filedeleter.cpp
0230 )
0231 
0232 ecm_qt_declare_logging_category(kgetcore
0233     HEADER kget_debug.h
0234     IDENTIFIER KGET_DEBUG
0235     CATEGORY_NAME kget
0236     DESCRIPTION "KGet"
0237     EXPORT KGET
0238 )
0239 
0240 kconfig_add_kcfg_files(kgetcore conf/settings.kcfgc)
0241 
0242 generate_export_header(kgetcore BASE_NAME kget)
0243 
0244 target_link_libraries(kgetcore
0245     KF5::ConfigGui
0246     KF5::CoreAddons
0247     KF5::DBusAddons
0248     KF5::I18n
0249     KF5::I18nLocaleData
0250     KF5::IconThemes
0251     KF5::KIOCore
0252     KF5::KIOWidgets
0253     KF5::Notifications
0254     KF5::XmlGui
0255     Qt::Core
0256     Qt::Widgets
0257     Qt::Sql
0258     Qt::Network
0259     Qt::DBus
0260     Boost::headers
0261 )
0262 
0263 if(LibKWorkspace_FOUND)
0264     target_link_libraries(kgetcore PW::KWorkspace)
0265 endif()
0266 
0267 if (SQLITE_FOUND)
0268     target_link_libraries(kgetcore ${QT_QTSQL_LIBRARY})
0269 endif()
0270 
0271 if (Qca-qt${QT_MAJOR_VERSION}_FOUND)
0272     target_link_libraries(kgetcore qca-qt${QT_MAJOR_VERSION})
0273 endif ()
0274 
0275 if (Gpgmepp_FOUND)
0276     target_link_libraries(kgetcore QGpgme Gpgmepp)
0277     kde_enable_exceptions()
0278 endif()
0279 
0280 install(TARGETS kgetcore ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
0281 
0282 
0283 # kget
0284 
0285 add_executable(kget)
0286 
0287 set(kget_dbus_SRCS)
0288 qt_add_dbus_adaptor(kget_dbus_SRCS dbus/org.kde.kget.main.xml dbus/dbuskgetwrapper.h DBusKGetWrapper)
0289 
0290 target_sources(kget PRIVATE
0291     ${kget_dbus_SRCS}
0292 #     core/transferhandler.cpp
0293 #     core/transfertreemodel.cpp
0294     dbus/dbuskgetwrapper.cpp
0295     kget_debug.cpp
0296     conf/autopastemodel.cpp
0297     conf/integrationpreferences.cpp
0298     conf/dlgwebinterface.cpp
0299     conf/preferencesdialog.cpp
0300     conf/transfersgrouptree.cpp
0301     conf/transfersgroupwidget.cpp
0302     conf/pluginselector.cpp
0303     conf/verificationpreferences.cpp
0304     ui/droptarget.cpp
0305     ui/transfersview.cpp
0306     ui/transfersviewdelegate.cpp
0307     ui/transferdetails.cpp
0308     ui/viewscontainer.cpp
0309     ui/newtransferdialog.cpp
0310     ui/groupsettingsdialog.cpp
0311     ui/transfersettingsdialog.cpp
0312     ui/contextmenu.cpp
0313     ui/tray.cpp
0314     ui/history/rangetreewidget.cpp
0315     ui/history/transferhistory.cpp
0316     ui/history/transferhistoryitemdelegate.cpp
0317     ui/history/transferhistorycategorizeddelegate.cpp
0318     ui/history/transferhistorycategorizedview.cpp
0319     ui/linkview/kget_linkview.cpp
0320     ui/linkview/kget_sortfilterproxymodel.cpp
0321     ui/mirror/mirrorsettings.cpp
0322     ui/mirror/mirrormodel.cpp
0323     ui/renamefile.cpp
0324     ui/verificationdialog.cpp
0325     ui/metalinkcreator/metalinkcreator.cpp
0326     ui/metalinkcreator/generalwidget.cpp
0327     ui/metalinkcreator/metalinker.cpp
0328     ui/metalinkcreator/filedlg.cpp
0329     ui/metalinkcreator/localemodels.cpp
0330     ui/metalinkcreator/dragdlg.cpp
0331     ui/metalinkcreator/urlwidget.cpp
0332     ui/metalinkcreator/filehandler.cpp
0333     ui/signaturedlg.cpp
0334     mainwindow.cpp
0335     main.cpp
0336 
0337    #extensions/webinterface/httpserver.cpp
0338 )
0339 
0340 ki18n_wrap_ui(kget
0341     conf/dlgadvanced.ui
0342     conf/dlgappearance.ui
0343     conf/dlggroups.ui
0344     conf/dlgintegration.ui
0345     conf/dlgwebinterface.ui
0346     conf/dlgnetwork.ui
0347     conf/verificationpreferences.ui
0348     ui/transferdetailsfrm.ui
0349     ui/newtransferwidget.ui
0350     ui/history/transferhistory.ui
0351     ui/groupsettingsdialog.ui
0352     ui/transfersettingsdialog.ui
0353     ui/linkview/importlinkdialog.ui
0354     ui/mirror/mirrorsettings.ui
0355     ui/mirror/mirroradddlg.ui
0356     ui/renamefile.ui
0357     ui/verificationdialog.ui
0358     ui/verificationadddlg.ui
0359     ui/metalinkcreator/introduction.ui
0360     ui/metalinkcreator/generalwidget.ui
0361     ui/metalinkcreator/files.ui
0362     ui/metalinkcreator/filedlg.ui
0363     ui/metalinkcreator/dragdlg.ui
0364     ui/metalinkcreator/urlwidget.ui
0365     ui/metalinkcreator/commondata.ui
0366     ui/signaturedlg.ui
0367 )
0368 
0369 file(GLOB ICON_SRCS "ui/icons/*-apps-kget.png")
0370 ecm_add_app_icon(kget ICONS ${ICON_SRCS})
0371 
0372 target_link_libraries(kget
0373     kgetcore
0374     KF5::Crash
0375     KF5::Wallet
0376     KF5::DBusAddons
0377     KF5::I18n
0378     KF5::Completion
0379     KF5::CoreAddons
0380     KF5::ItemViews
0381     KF5::KCMUtils
0382     KF5::NotifyConfig
0383     KF5::WindowSystem
0384     Qt::Core
0385     Qt::Widgets
0386     Qt::Sql
0387     Qt::Network
0388     Qt::DBus
0389 )
0390 if(Qca_FOUND)
0391     target_link_libraries(kget qca)
0392 endif()
0393 if(CMAKE_BUILD_TYPE MATCHES debugfull)
0394     target_link_libraries(kget Qt::Test)
0395 endif()
0396 
0397 if (Gpgmepp_FOUND)
0398     if (QT_MAJOR_VERSION STREQUAL "6")
0399         target_link_libraries(kget QGpgmeQt6)
0400     else()
0401         target_link_libraries(kget QGpgme)
0402     endif()
0403 endif()
0404 
0405 install(TARGETS kget ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
0406 
0407 ecm_qt_install_logging_categories(
0408     EXPORT KGET
0409     FILE kget.categories
0410     DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
0411 )
0412 install(FILES org.kde.kget.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
0413 
0414 # add clang-format target for all our real source files
0415 file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
0416 kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
0417 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
0418 
0419 ki18n_install(po)
0420 kdoctools_install(po)
0421 
0422 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)