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 "24")
0005 set(RELEASE_SERVICE_VERSION_MINOR "04")
0006 set(RELEASE_SERVICE_VERSION_MICRO "70")
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 "6.5.0")
0012 set(KF_VERSION "5.240.0")
0013 set(KDE_COMPILERSETTINGS_LEVEL "5.82")
0014
0015 find_package(ECM ${KF_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(Qt6 ${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(KF6 ${KF_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 StatusNotifierItem
0059 Wallet
0060 WidgetsAddons
0061 WindowSystem
0062 XmlGui
0063 )
0064
0065 #include(CheckIncludeFile)
0066 #include(CheckIncludeFiles)
0067 #include(CheckSymbolExists)
0068 #include(CheckFunctionExists)
0069 #include(CheckLibraryExists)
0070 #include(CheckPrototypeExists)
0071 #include(CheckTypeSize)
0072
0073 if(WIN32)
0074 set(CMAKE_REQUIRED_LIBRARIES ${KDEWIN32_LIBRARIES})
0075 set(CMAKE_REQUIRED_INCLUDES ${KDEWIN32_INCLUDES})
0076 endif()
0077
0078 find_package(SQLite3)
0079 set_package_properties(SQLite3 PROPERTIES
0080 DESCRIPTION "SQLite is a Binary-Database"
0081 TYPE RECOMMENDED
0082 PURPOSE "Needed for the SQLite-Backend of the KGet-History"
0083 )
0084
0085 if (NOT WIN32)
0086 find_package(Gpgmepp 1.7.0)
0087 set_package_properties(Gpgmepp PROPERTIES
0088 DESCRIPTION "The GpgME++ library"
0089 URL "https://www.gnupg.org"
0090 TYPE RECOMMENDED
0091 PURPOSE "GpgME++ is required to have signature verifying support in KGet."
0092 )
0093
0094 find_package(QGpgmeQt6 1.7.0 CONFIG)
0095 set_package_properties(Gpgmepp PROPERTIES
0096 DESCRIPTION "QGpgME Library"
0097 URL "https://www.gnupg.org"
0098 TYPE OPTIONAL
0099 PURPOSE "QGpgME is required to have signature verifying support in KGet."
0100 )
0101 endif()
0102
0103 find_package(KTorrent6 23.11.70)
0104 set_package_properties(KTorrent6 PROPERTIES
0105 DESCRIPTION "Backend Library of KTorrent"
0106 TYPE RECOMMENDED
0107 PURPOSE "Needed to build KGet bittorrent support."
0108 )
0109
0110 find_package(LibMms)
0111 set_package_properties(LibMms PROPERTIES
0112 DESCRIPTION "Library to read mms streams"
0113 TYPE RECOMMENDED
0114 PURPOSE "Needed to build KGet mms support."
0115 )
0116
0117 if(CMAKE_BUILD_TYPE MATCHES debugfull)
0118 add_definitions(-DDEBUG)
0119 endif()
0120
0121 find_package(Boost REQUIRED)
0122
0123 if (Gpgmepp_FOUND AND NOT WIN32)
0124 find_package(QGpgmeQt6 ${GPGME_REQUIRED_VERSION} CONFIG REQUIRED)
0125 add_definitions(-DHAVE_QGPGME)
0126 endif()
0127
0128 set (KGET_PLUGIN_INSTALL_DIR ${KDE_INSTALL_PLUGINDIR}/kget)
0129
0130 add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
0131
0132 include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
0133
0134 ecm_setup_version(PROJECT
0135 VARIABLE_PREFIX KGET
0136 VERSION_HEADER "kget_version.h"
0137 )
0138
0139 ecm_setup_qtplugin_macro_names(JSON_NONE KGET_EXPORT_PLUGIN KGET_EXPORT_PLUGIN_CONFIG)
0140
0141 add_subdirectory(conf)
0142 add_subdirectory(core)
0143 add_subdirectory(ui)
0144 add_subdirectory(transfer-plugins)
0145 add_subdirectory(sounds)
0146 add_subdirectory(desktop)
0147 add_subdirectory(tests)
0148 add_subdirectory(doc)
0149
0150 include_directories(
0151 ${CMAKE_CURRENT_SOURCE_DIR}/core/
0152 ${CMAKE_CURRENT_BINARY_DIR}/core/
0153 )
0154
0155 if(SQLite3_FOUND)
0156 add_definitions(-DHAVE_SQLITE)
0157 endif()
0158
0159 remove_definitions(-DQT_NO_HTTP)
0160
0161 # kgetcore
0162
0163 add_library(kgetcore SHARED)
0164 set_target_properties(kgetcore PROPERTIES
0165 VERSION 6.0.0
0166 SOVERSION 6
0167 )
0168
0169 set(kgetcore_dbus_SRCS)
0170 qt_add_dbus_adaptor(kgetcore_dbus_SRCS dbus/org.kde.kget.transfer.xml dbus/dbustransferwrapper.h DBusTransferWrapper)
0171 qt_add_dbus_adaptor(kgetcore_dbus_SRCS dbus/org.kde.kget.verifier.xml dbus/dbusverifierwrapper.h DBusVerifierWrapper)
0172
0173 qt_add_dbus_interface(kgetcore_dbus_SRCS dbus/org.kde.Shutdown.xml plasmashudown_interface)
0174
0175 target_sources(kgetcore PRIVATE
0176 ${kgetcore_dbus_SRCS}
0177 core/job.cpp
0178 core/jobqueue.cpp
0179 core/kget.cpp
0180 core/scheduler.cpp
0181 core/transfertreemodel.cpp
0182 core/transfertreeselectionmodel.cpp
0183 core/transfer.cpp
0184 core/transfergroup.cpp
0185 core/transfergrouphandler.cpp
0186 core/transferhandler.cpp
0187 core/handler.cpp
0188 core/transfergroupscheduler.cpp
0189 core/plugin/plugin.cpp
0190 core/plugin/transferfactory.cpp
0191 core/transferdatasource.cpp
0192 core/datasourcefactory.cpp
0193 core/kgetkjobadapter.cpp
0194 core/kuiserverjobs.cpp
0195 core/kgetglobaljob.cpp
0196 core/bitset.cpp
0197 core/download.cpp
0198 core/transferhistorystore.cpp
0199 core/transferhistorystore_xml.cpp
0200 core/transferhistorystore_sqlite.cpp
0201 core/linkimporter.cpp
0202 dbus/dbustransferwrapper.cpp
0203 dbus/dbusverifierwrapper.cpp
0204 core/filemodel.cpp
0205 core/verifier.cpp
0206 core/verificationthread.cpp
0207 core/verificationmodel.cpp
0208 core/verificationdelegate.cpp
0209 core/signature.cpp
0210 core/signaturethread.cpp
0211 core/keydownloader.cpp
0212 core/urlchecker.cpp
0213 core/basedialog.cpp
0214 core/mostlocalurl.cpp
0215 core/filedeleter.cpp
0216 )
0217
0218 ecm_qt_declare_logging_category(kgetcore
0219 HEADER kget_debug.h
0220 IDENTIFIER KGET_DEBUG
0221 CATEGORY_NAME kget
0222 DESCRIPTION "KGet"
0223 EXPORT KGET
0224 )
0225
0226 kconfig_add_kcfg_files(kgetcore conf/settings.kcfgc)
0227
0228 generate_export_header(kgetcore BASE_NAME kget)
0229
0230 target_link_libraries(kgetcore PUBLIC
0231 KF6::ConfigGui
0232 KF6::CoreAddons
0233 KF6::DBusAddons
0234 KF6::I18n
0235 KF6::I18nLocaleData
0236 KF6::IconThemes
0237 KF6::IconWidgets
0238 KF6::KCMUtils
0239 KF6::KIOCore
0240 KF6::KIOWidgets
0241 KF6::Notifications
0242 KF6::StatusNotifierItem
0243 KF6::XmlGui
0244 Qt6::Core
0245 Qt6::Widgets
0246 Qt6::Sql
0247 Qt6::Network
0248 Qt6::DBus
0249 Boost::headers
0250 )
0251
0252 if (SQLITE_FOUND)
0253 target_link_libraries(kgetcore PUBLIC ${QT_QTSQL_LIBRARY})
0254 endif()
0255
0256 if (TARGET Gpgmepp)
0257 target_link_libraries(kgetcore PUBLIC QGpgmeQt6 Gpgmepp)
0258 kde_enable_exceptions()
0259 endif()
0260
0261 install(TARGETS kgetcore ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
0262
0263
0264 # kget
0265
0266 add_executable(kget)
0267
0268 set(kget_dbus_SRCS)
0269 qt_add_dbus_adaptor(kget_dbus_SRCS dbus/org.kde.kget.main.xml dbus/dbuskgetwrapper.h DBusKGetWrapper)
0270
0271 target_sources(kget PRIVATE
0272 ${kget_dbus_SRCS}
0273 # core/transferhandler.cpp
0274 # core/transfertreemodel.cpp
0275 dbus/dbuskgetwrapper.cpp
0276 kget_debug.cpp
0277 conf/autopastemodel.cpp
0278 conf/integrationpreferences.cpp
0279 conf/dlgwebinterface.cpp
0280 conf/preferencesdialog.cpp
0281 conf/transfersgrouptree.cpp
0282 conf/transfersgroupwidget.cpp
0283 conf/pluginselector.cpp
0284 conf/verificationpreferences.cpp
0285 ui/droptarget.cpp
0286 ui/transfersview.cpp
0287 ui/transfersviewdelegate.cpp
0288 ui/transferdetails.cpp
0289 ui/viewscontainer.cpp
0290 ui/newtransferdialog.cpp
0291 ui/groupsettingsdialog.cpp
0292 ui/transfersettingsdialog.cpp
0293 ui/contextmenu.cpp
0294 ui/tray.cpp
0295 ui/history/rangetreewidget.cpp
0296 ui/history/transferhistory.cpp
0297 ui/history/transferhistoryitemdelegate.cpp
0298 ui/history/transferhistorycategorizeddelegate.cpp
0299 ui/history/transferhistorycategorizedview.cpp
0300 ui/linkview/kget_linkview.cpp
0301 ui/linkview/kget_sortfilterproxymodel.cpp
0302 ui/mirror/mirrorsettings.cpp
0303 ui/mirror/mirrormodel.cpp
0304 ui/renamefile.cpp
0305 ui/verificationdialog.cpp
0306 ui/metalinkcreator/metalinkcreator.cpp
0307 ui/metalinkcreator/generalwidget.cpp
0308 ui/metalinkcreator/metalinker.cpp
0309 ui/metalinkcreator/filedlg.cpp
0310 ui/metalinkcreator/localemodels.cpp
0311 ui/metalinkcreator/dragdlg.cpp
0312 ui/metalinkcreator/urlwidget.cpp
0313 ui/metalinkcreator/filehandler.cpp
0314 ui/signaturedlg.cpp
0315 mainwindow.cpp
0316 main.cpp
0317
0318 ui/kgetui.qrc
0319
0320 #extensions/webinterface/httpserver.cpp
0321 )
0322
0323 ki18n_wrap_ui(kget
0324 conf/dlgadvanced.ui
0325 conf/dlgappearance.ui
0326 conf/dlggroups.ui
0327 conf/dlgintegration.ui
0328 conf/dlgwebinterface.ui
0329 conf/dlgnetwork.ui
0330 conf/verificationpreferences.ui
0331 ui/transferdetailsfrm.ui
0332 ui/newtransferwidget.ui
0333 ui/history/transferhistory.ui
0334 ui/groupsettingsdialog.ui
0335 ui/transfersettingsdialog.ui
0336 ui/linkview/importlinkdialog.ui
0337 ui/mirror/mirrorsettings.ui
0338 ui/mirror/mirroradddlg.ui
0339 ui/renamefile.ui
0340 ui/verificationdialog.ui
0341 ui/verificationadddlg.ui
0342 ui/metalinkcreator/introduction.ui
0343 ui/metalinkcreator/generalwidget.ui
0344 ui/metalinkcreator/files.ui
0345 ui/metalinkcreator/filedlg.ui
0346 ui/metalinkcreator/dragdlg.ui
0347 ui/metalinkcreator/urlwidget.ui
0348 ui/metalinkcreator/commondata.ui
0349 ui/signaturedlg.ui
0350 )
0351
0352 file(GLOB ICON_SRCS "ui/icons/*-apps-kget.png")
0353 ecm_add_app_icon(kget ICONS ${ICON_SRCS})
0354
0355 target_link_libraries(kget
0356 kgetcore
0357 KF6::Crash
0358 KF6::Wallet
0359 KF6::DBusAddons
0360 KF6::I18n
0361 KF6::Completion
0362 KF6::CoreAddons
0363 KF6::ItemViews
0364 KF6::KCMUtils
0365 KF6::NotifyConfig
0366 KF6::WindowSystem
0367 Qt::Core
0368 Qt::Widgets
0369 Qt::Sql
0370 Qt::Network
0371 Qt::DBus
0372 )
0373 if(CMAKE_BUILD_TYPE MATCHES debugfull)
0374 target_link_libraries(kget Qt::Test)
0375 endif()
0376
0377 if (Gpgmepp_FOUND)
0378 if (QT_MAJOR_VERSION STREQUAL "6")
0379 target_link_libraries(kget QGpgmeQt6)
0380 else()
0381 target_link_libraries(kget QGpgme)
0382 endif()
0383 endif()
0384
0385 install(TARGETS kget ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
0386
0387 ecm_qt_install_logging_categories(
0388 EXPORT KGET
0389 FILE kget.categories
0390 DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
0391 )
0392 install(FILES org.kde.kget.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
0393
0394 # add clang-format target for all our real source files
0395 file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
0396 kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
0397 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
0398
0399 ki18n_install(po)
0400 kdoctools_install(po)
0401
0402 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)