Browse Source

CMake: Don't split GUI code into several libraries

adaptive-webui-19844
Vladimir Golovnev (Glassez) 5 years ago
parent
commit
642bf7b8a6
No known key found for this signature in database
GPG Key ID: 52A2C7DEE2DFA6F7
  1. 6
      CMakeLists.txt
  2. 13
      dist/CMakeLists.txt
  3. 2
      src/CMakeLists.txt
  4. 87
      src/app/CMakeLists.txt
  5. 312
      src/base/CMakeLists.txt
  6. 7
      src/base/preferences.cpp
  7. 299
      src/gui/CMakeLists.txt
  8. 11
      src/gui/log/CMakeLists.txt
  9. 23
      src/gui/powermanagement/CMakeLists.txt
  10. 84
      src/gui/properties/CMakeLists.txt
  11. 12
      src/gui/qtnotify/CMakeLists.txt
  12. 40
      src/gui/rss/CMakeLists.txt
  13. 49
      src/gui/search/CMakeLists.txt

6
CMakeLists.txt

@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
message(AUTHOR_WARNING "If the build fails, please try the autotools/qmake method.") message(AUTHOR_WARNING "If the build fails, please try the autotools/qmake method.")
if(POLICY CMP0074) if (POLICY CMP0074)
cmake_policy(SET CMP0074 NEW) cmake_policy(SET CMP0074 NEW)
endif() endif()
@ -45,9 +45,9 @@ set(requiredQtVersion 5.9.0)
set(requiredOpensslVersion 1.0) set(requiredOpensslVersion 1.0)
set(requiredLibtorrentVersion 1.1.10) set(requiredLibtorrentVersion 1.1.10)
if(WIN32) if (WIN32)
include(winconf) include(winconf)
endif(WIN32) endif()
# we need options here, at the top level, because they are used not only in "src" subdir, but in the "dist" dir too # we need options here, at the top level, because they are used not only in "src" subdir, but in the "dist" dir too

13
dist/CMakeLists.txt vendored

@ -2,11 +2,8 @@ find_package(Qt5Widgets ${requiredQtVersion}) # to conditionally install desktop
if (APPLE) if (APPLE)
add_subdirectory(mac) add_subdirectory(mac)
else (APPLE) elseif (UNIX)
if (UNIX) add_subdirectory(unix)
add_subdirectory(unix) elseif (WIN32)
endif (UNIX) add_subdirectory(windows)
if (WIN32) endif()
add_subdirectory(windows)
endif (WIN32)
endif (APPLE)

2
src/CMakeLists.txt

@ -37,7 +37,7 @@ if (APPLE)
# Workaround CMake bug (autogen does not pass required parameters to moc) # Workaround CMake bug (autogen does not pass required parameters to moc)
# Relevant issue: https://gitlab.kitware.com/cmake/cmake/issues/18041 # Relevant issue: https://gitlab.kitware.com/cmake/cmake/issues/18041
list(APPEND CMAKE_AUTOMOC_MOC_OPTIONS -DQ_OS_MACOS -DQ_OS_DARWIN) list(APPEND CMAKE_AUTOMOC_MOC_OPTIONS -DQ_OS_MACOS -DQ_OS_DARWIN)
endif () endif()
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR})

87
src/app/CMakeLists.txt

@ -1,27 +1,24 @@
add_executable(qBittorrent add_executable(qBittorrent
# headers # headers
application.h application.h
applicationinstancemanager.h applicationinstancemanager.h
cmdoptions.h cmdoptions.h
filelogger.h filelogger.h
qtlocalpeer/qtlocalpeer.h qtlocalpeer/qtlocalpeer.h
upgrade.h upgrade.h
# sources # sources
application.cpp application.cpp
applicationinstancemanager.cpp applicationinstancemanager.cpp
cmdoptions.cpp cmdoptions.cpp
filelogger.cpp filelogger.cpp
main.cpp main.cpp
qtlocalpeer/qtlocalpeer.cpp qtlocalpeer/qtlocalpeer.cpp
upgrade.cpp upgrade.cpp
) )
target_include_directories(qBittorrent PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_include_directories(qBittorrent PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(qBittorrent target_link_libraries(qBittorrent PRIVATE qbt_base)
PRIVATE
qbt_base
)
set_target_properties(qBittorrent set_target_properties(qBittorrent
PROPERTIES PROPERTIES
@ -42,8 +39,8 @@ if (NOT DISABLE_WEBUI)
endif() endif()
set(QBT_APP_RESOURCES set(QBT_APP_RESOURCES
../icons/icons.qrc ../icons/icons.qrc
../searchengine/searchengine.qrc ../searchengine/searchengine.qrc
) )
# With AUTORCC rcc is ran by cmake before language files are generated, # With AUTORCC rcc is ran by cmake before language files are generated,
@ -53,49 +50,53 @@ qt5_add_resources(QBT_APP_RESOURCE_SOURCE ${QBT_APP_RESOURCES})
if (WIN32) if (WIN32)
if (MINGW) if (MINGW)
target_sources(qBittorrent PRIVATE ../qbittorrent_mingw.rc) target_sources(qBittorrent PRIVATE ../qbittorrent_mingw.rc)
else (MINGW) else()
target_sources(qBittorrent PRIVATE ../qbittorrent.rc) target_sources(qBittorrent PRIVATE ../qbittorrent.rc)
endif (MINGW) endif()
target_sources(qBittorrent PRIVATE ../qbittorrent.exe.manifest) target_sources(qBittorrent PRIVATE ../qbittorrent.exe.manifest)
endif (WIN32) endif()
if (STACKTRACE) if (STACKTRACE)
if (UNIX) if (UNIX)
target_sources(qBittorrent PRIVATE stacktrace.h) target_sources(qBittorrent PRIVATE stacktrace.h)
else (UNIX) else()
target_sources(qBittorrent PRIVATE stacktrace_win.h) target_sources(qBittorrent PRIVATE stacktrace_win.h)
if (Qt5Widgets_FOUND) if (Qt5Widgets_FOUND)
target_sources(qBittorrent PRIVATE stacktracedialog.cpp stacktracedialog.h) target_sources(qBittorrent PRIVATE stacktracedialog.cpp stacktracedialog.h)
endif (Qt5Widgets_FOUND) endif()
if (MSVC) if (MSVC)
if (NOT "${WINXXBITS}" STREQUAL "Win64") if (NOT "${WINXXBITS}" STREQUAL "Win64")
# i686 arch requires frame pointer preservation # i686 arch requires frame pointer preservation
add_compile_options(-Oy-) add_compile_options(-Oy-)
endif (NOT "${WINXXBITS}" STREQUAL "Win64") endif()
add_compile_options(-Zi) add_compile_options(-Zi)
target_link_libraries(qBittorrent PUBLIC dbghelp -DEBUG) target_link_libraries(qBittorrent PUBLIC dbghelp -DEBUG)
else (MSVC) else()
if (NOT "${WINXXBITS}" STREQUAL "Win64") if (NOT "${WINXXBITS}" STREQUAL "Win64")
add_compile_options(-fno-omit-frame-pointer) add_compile_options(-fno-omit-frame-pointer)
endif (NOT "${WINXXBITS}" STREQUAL "Win64") endif()
target_link_libraries(qBittorrent PUBLIC dbghelp -Wl,--export-all-symbols) target_link_libraries(qBittorrent PUBLIC dbghelp -Wl,--export-all-symbols)
endif (MSVC) endif()
endif (UNIX) endif()
endif (STACKTRACE) endif()
if (Qt5Widgets_FOUND) if (Qt5Widgets_FOUND)
target_link_libraries(qBittorrent PRIVATE qbt_searchengine qbt_gui) target_link_libraries(qBittorrent PRIVATE qbt_gui)
set_target_properties(qBittorrent set_target_properties(qBittorrent
PROPERTIES PROPERTIES
OUTPUT_NAME qbittorrent OUTPUT_NAME qbittorrent
WIN32_EXECUTABLE True WIN32_EXECUTABLE True
) )
else(Qt5Widgets_FOUND) else()
set_target_properties(qBittorrent set_target_properties(qBittorrent
PROPERTIES PROPERTIES
OUTPUT_NAME qbittorrent-nox OUTPUT_NAME qbittorrent-nox
) )
endif (Qt5Widgets_FOUND) endif()
if (NOT DISABLE_WEBUI) if (NOT DISABLE_WEBUI)
target_link_libraries(qBittorrent PRIVATE qbt_webui) target_link_libraries(qBittorrent PRIVATE qbt_webui)
@ -127,9 +128,8 @@ if (APPLE)
${QT_TR_DIR}/qt_zh_CN.qm ${QT_TR_DIR}/qt_zh_CN.qm
) )
list(APPEND QBT_APP_RESOURCE_SOURCE ${QT_TRANSLATIONS}) list(APPEND QBT_APP_RESOURCE_SOURCE ${QT_TRANSLATIONS})
set_source_files_properties(${QT_TRANSLATIONS} set_source_files_properties(${QT_TRANSLATIONS} PROPERTIES MACOSX_PACKAGE_LOCATION translations)
PROPERTIES MACOSX_PACKAGE_LOCATION translations) endif()
endif (APPLE)
target_sources(qBittorrent PRIVATE ${QBT_QM_FILES} ${QBT_APP_RESOURCE_SOURCE}) target_sources(qBittorrent PRIVATE ${QBT_QM_FILES} ${QBT_APP_RESOURCE_SOURCE})
@ -138,7 +138,7 @@ get_target_property(QBT_EXECUTABLE_NAME qBittorrent OUTPUT_NAME)
if (APPLE) if (APPLE)
set(qbt_BUNDLE_NAME ${QBT_EXECUTABLE_NAME}) set(qbt_BUNDLE_NAME ${QBT_EXECUTABLE_NAME})
# substitute @EXECUTABLE@ in dist/mac/Info.plist # substitute @EXECUTABLE@ in dist/mac/Info.plist
set(EXECUTABLE ${qbt_BUNDLE_NAME}) set(EXECUTABLE ${qbt_BUNDLE_NAME})
configure_file(${qBittorrent_SOURCE_DIR}/dist/mac/Info.plist ${qBittorrent_BINARY_DIR}/dist/mac/Info.plist @ONLY) configure_file(${qBittorrent_SOURCE_DIR}/dist/mac/Info.plist ${qBittorrent_BINARY_DIR}/dist/mac/Info.plist @ONLY)
@ -146,15 +146,16 @@ if (APPLE)
MACOSX_BUNDLE_BUNDLE_NAME "${qbt_BUNDLE_NAME}" MACOSX_BUNDLE_BUNDLE_NAME "${qbt_BUNDLE_NAME}"
MACOSX_BUNDLE_INFO_PLIST ${qBittorrent_BINARY_DIR}/dist/mac/Info.plist MACOSX_BUNDLE_INFO_PLIST ${qBittorrent_BINARY_DIR}/dist/mac/Info.plist
) )
endif (APPLE) endif()
# installation # installation
install(TARGETS qBittorrent install(TARGETS qBittorrent
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
BUNDLE DESTINATION . BUNDLE DESTINATION .
COMPONENT runtime) COMPONENT runtime
)
if (Qt5Widgets_FOUND AND APPLE) if (Qt5Widgets_FOUND AND APPLE)
find_package(Qt5Svg REQUIRED) find_package(Qt5Svg REQUIRED)
include(bundle) include(bundle)
endif (Qt5Widgets_FOUND AND APPLE) endif()

312
src/base/CMakeLists.txt

@ -1,159 +1,159 @@
find_package(ZLIB 1.2.5.2 REQUIRED) find_package(ZLIB 1.2.5.2 REQUIRED)
add_library(qbt_base STATIC add_library(qbt_base STATIC
# headers # headers
bittorrent/addtorrentparams.h bittorrent/addtorrentparams.h
bittorrent/cachestatus.h bittorrent/cachestatus.h
bittorrent/downloadpriority.h bittorrent/downloadpriority.h
bittorrent/infohash.h bittorrent/infohash.h
bittorrent/magneturi.h bittorrent/magneturi.h
bittorrent/peeraddress.h bittorrent/peeraddress.h
bittorrent/peerinfo.h bittorrent/peerinfo.h
bittorrent/private/bandwidthscheduler.h bittorrent/private/bandwidthscheduler.h
bittorrent/private/filterparserthread.h bittorrent/private/filterparserthread.h
bittorrent/private/ltunderlyingtype.h bittorrent/private/ltunderlyingtype.h
bittorrent/private/nativesessionextension.h bittorrent/private/nativesessionextension.h
bittorrent/private/nativetorrentextension.h bittorrent/private/nativetorrentextension.h
bittorrent/private/portforwarderimpl.h bittorrent/private/portforwarderimpl.h
bittorrent/private/resumedatasavingmanager.h bittorrent/private/resumedatasavingmanager.h
bittorrent/private/speedmonitor.h bittorrent/private/speedmonitor.h
bittorrent/private/statistics.h bittorrent/private/statistics.h
bittorrent/session.h bittorrent/session.h
bittorrent/sessionstatus.h bittorrent/sessionstatus.h
bittorrent/torrentcreatorthread.h bittorrent/torrentcreatorthread.h
bittorrent/torrenthandle.h bittorrent/torrenthandle.h
bittorrent/torrenthandleimpl.h bittorrent/torrenthandleimpl.h
bittorrent/torrentinfo.h bittorrent/torrentinfo.h
bittorrent/tracker.h bittorrent/tracker.h
bittorrent/trackerentry.h bittorrent/trackerentry.h
http/connection.h http/connection.h
http/httperror.h http/httperror.h
http/irequesthandler.h http/irequesthandler.h
http/requestparser.h http/requestparser.h
http/responsebuilder.h http/responsebuilder.h
http/responsegenerator.h http/responsegenerator.h
http/server.h http/server.h
http/types.h http/types.h
net/dnsupdater.h net/dnsupdater.h
net/downloadmanager.h net/downloadmanager.h
net/geoipmanager.h net/geoipmanager.h
net/portforwarder.h net/portforwarder.h
net/private/downloadhandlerimpl.h net/private/downloadhandlerimpl.h
net/private/geoipdatabase.h net/private/geoipdatabase.h
net/proxyconfigurationmanager.h net/proxyconfigurationmanager.h
net/reverseresolution.h net/reverseresolution.h
net/smtp.h net/smtp.h
private/profile_p.h private/profile_p.h
rss/private/rss_parser.h rss/private/rss_parser.h
rss/rss_article.h rss/rss_article.h
rss/rss_autodownloader.h rss/rss_autodownloader.h
rss/rss_autodownloadrule.h rss/rss_autodownloadrule.h
rss/rss_feed.h rss/rss_feed.h
rss/rss_folder.h rss/rss_folder.h
rss/rss_item.h rss/rss_item.h
rss/rss_session.h rss/rss_session.h
search/searchdownloadhandler.h search/searchdownloadhandler.h
search/searchhandler.h search/searchhandler.h
search/searchpluginmanager.h search/searchpluginmanager.h
utils/bytearray.h utils/bytearray.h
utils/foreignapps.h utils/foreignapps.h
utils/fs.h utils/fs.h
utils/gzip.h utils/gzip.h
utils/io.h utils/io.h
utils/misc.h utils/misc.h
utils/net.h utils/net.h
utils/password.h utils/password.h
utils/random.h utils/random.h
utils/string.h utils/string.h
utils/version.h utils/version.h
algorithm.h algorithm.h
asyncfilestorage.h asyncfilestorage.h
exceptions.h exceptions.h
filesystemwatcher.h filesystemwatcher.h
global.h global.h
iconprovider.h iconprovider.h
indexrange.h indexrange.h
logger.h logger.h
preferences.h preferences.h
profile.h profile.h
scanfoldersmodel.h scanfoldersmodel.h
settingsstorage.h settingsstorage.h
torrentfileguard.h torrentfileguard.h
torrentfilter.h torrentfilter.h
tristatebool.h tristatebool.h
types.h types.h
unicodestrings.h unicodestrings.h
# sources # sources
bittorrent/downloadpriority.cpp bittorrent/downloadpriority.cpp
bittorrent/infohash.cpp bittorrent/infohash.cpp
bittorrent/magneturi.cpp bittorrent/magneturi.cpp
bittorrent/peeraddress.cpp bittorrent/peeraddress.cpp
bittorrent/peerinfo.cpp bittorrent/peerinfo.cpp
bittorrent/private/bandwidthscheduler.cpp bittorrent/private/bandwidthscheduler.cpp
bittorrent/private/filterparserthread.cpp bittorrent/private/filterparserthread.cpp
bittorrent/private/nativesessionextension.cpp bittorrent/private/nativesessionextension.cpp
bittorrent/private/nativetorrentextension.cpp bittorrent/private/nativetorrentextension.cpp
bittorrent/private/portforwarderimpl.cpp bittorrent/private/portforwarderimpl.cpp
bittorrent/private/resumedatasavingmanager.cpp bittorrent/private/resumedatasavingmanager.cpp
bittorrent/private/speedmonitor.cpp bittorrent/private/speedmonitor.cpp
bittorrent/private/statistics.cpp bittorrent/private/statistics.cpp
bittorrent/session.cpp bittorrent/session.cpp
bittorrent/torrentcreatorthread.cpp bittorrent/torrentcreatorthread.cpp
bittorrent/torrenthandle.cpp bittorrent/torrenthandle.cpp
bittorrent/torrenthandleimpl.cpp bittorrent/torrenthandleimpl.cpp
bittorrent/torrentinfo.cpp bittorrent/torrentinfo.cpp
bittorrent/tracker.cpp bittorrent/tracker.cpp
bittorrent/trackerentry.cpp bittorrent/trackerentry.cpp
http/connection.cpp http/connection.cpp
http/httperror.cpp http/httperror.cpp
http/requestparser.cpp http/requestparser.cpp
http/responsebuilder.cpp http/responsebuilder.cpp
http/responsegenerator.cpp http/responsegenerator.cpp
http/server.cpp http/server.cpp
net/dnsupdater.cpp net/dnsupdater.cpp
net/downloadmanager.cpp net/downloadmanager.cpp
net/geoipmanager.cpp net/geoipmanager.cpp
net/portforwarder.cpp net/portforwarder.cpp
net/private/downloadhandlerimpl.cpp net/private/downloadhandlerimpl.cpp
net/private/geoipdatabase.cpp net/private/geoipdatabase.cpp
net/proxyconfigurationmanager.cpp net/proxyconfigurationmanager.cpp
net/reverseresolution.cpp net/reverseresolution.cpp
net/smtp.cpp net/smtp.cpp
private/profile_p.cpp private/profile_p.cpp
rss/private/rss_parser.cpp rss/private/rss_parser.cpp
rss/rss_article.cpp rss/rss_article.cpp
rss/rss_autodownloader.cpp rss/rss_autodownloader.cpp
rss/rss_autodownloadrule.cpp rss/rss_autodownloadrule.cpp
rss/rss_feed.cpp rss/rss_feed.cpp
rss/rss_folder.cpp rss/rss_folder.cpp
rss/rss_item.cpp rss/rss_item.cpp
rss/rss_session.cpp rss/rss_session.cpp
search/searchdownloadhandler.cpp search/searchdownloadhandler.cpp
search/searchhandler.cpp search/searchhandler.cpp
search/searchpluginmanager.cpp search/searchpluginmanager.cpp
utils/bytearray.cpp utils/bytearray.cpp
utils/foreignapps.cpp utils/foreignapps.cpp
utils/fs.cpp utils/fs.cpp
utils/gzip.cpp utils/gzip.cpp
utils/io.cpp utils/io.cpp
utils/misc.cpp utils/misc.cpp
utils/net.cpp utils/net.cpp
utils/password.cpp utils/password.cpp
utils/random.cpp utils/random.cpp
utils/string.cpp utils/string.cpp
asyncfilestorage.cpp asyncfilestorage.cpp
exceptions.cpp exceptions.cpp
filesystemwatcher.cpp filesystemwatcher.cpp
iconprovider.cpp iconprovider.cpp
logger.cpp logger.cpp
preferences.cpp preferences.cpp
profile.cpp profile.cpp
scanfoldersmodel.cpp scanfoldersmodel.cpp
settingsstorage.cpp settingsstorage.cpp
torrentfileguard.cpp torrentfileguard.cpp
torrentfilter.cpp torrentfilter.cpp
tristatebool.cpp tristatebool.cpp
) )
target_link_libraries(qbt_base target_link_libraries(qbt_base
@ -164,17 +164,13 @@ target_link_libraries(qbt_base
Qt5::Core Qt5::Network Qt5::Xml Qt5::Core Qt5::Network Qt5::Xml
) )
if (Qt5Widgets_FOUND)
target_link_libraries(qbt_base PUBLIC Qt5::Gui Qt5::Widgets)
endif (Qt5Widgets_FOUND)
if (Qt5DBus_FOUND) if (Qt5DBus_FOUND)
target_link_libraries(qbt_base PRIVATE Qt5::DBus) target_link_libraries(qbt_base PRIVATE Qt5::DBus)
endif () endif()
if (APPLE) if (APPLE)
find_library(IOKit_LIBRARY IOKit) find_library(IOKit_LIBRARY IOKit)
find_library(Carbon_LIBRARY Carbon) find_library(Carbon_LIBRARY Carbon)
find_library(AppKit_LIBRARY AppKit) find_library(AppKit_LIBRARY AppKit)
target_link_libraries(qbt_base PRIVATE ${Carbon_LIBRARY} ${IOKit_LIBRARY} ${AppKit_LIBRARY}) target_link_libraries(qbt_base PRIVATE ${Carbon_LIBRARY} ${IOKit_LIBRARY} ${AppKit_LIBRARY})
endif (APPLE) endif()

7
src/base/preferences.cpp

@ -38,6 +38,7 @@
#include <shlobj.h> #include <shlobj.h>
#endif #endif
#include <QCoreApplication>
#include <QDateTime> #include <QDateTime>
#include <QDir> #include <QDir>
#include <QLocale> #include <QLocale>
@ -47,12 +48,6 @@
#include <QTime> #include <QTime>
#include <QVariant> #include <QVariant>
#ifndef DISABLE_GUI
#include <QApplication>
#else
#include <QCoreApplication>
#endif
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
#include <QRegularExpression> #include <QRegularExpression>
#endif #endif

299
src/gui/CMakeLists.txt

@ -1,176 +1,165 @@
set(CMAKE_AUTORCC True) set(CMAKE_AUTORCC True)
set(CMAKE_AUTOUIC True) set(CMAKE_AUTOUIC True)
add_library(qbt_gui_headers INTERFACE) add_library(qbt_gui STATIC
target_include_directories(qbt_gui_headers INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) # headers
aboutdialog.h
addnewtorrentdialog.h
advancedsettings.h
autoexpandabledialog.h
banlistoptionsdialog.h
categoryfiltermodel.h
categoryfilterproxymodel.h
categoryfilterwidget.h
cookiesdialog.h
cookiesmodel.h
deletionconfirmationdialog.h
downloadfromurldialog.h
executionlogwidget.h
fspathedit.h
hidabletabwidget.h
ipsubnetwhitelistoptionsdialog.h
lineedit.h
mainwindow.h
optionsdialog.h
previewlistdelegate.h
previewselectdialog.h
private/fspathedit_p.h
private/tristatewidget.h
raisedmessagebox.h
scanfoldersdelegate.h
shutdownconfirmdialog.h
speedlimitdialog.h
statsdialog.h
statusbar.h
tagfiltermodel.h
tagfilterproxymodel.h
tagfilterwidget.h
torrentcategorydialog.h
torrentcontentfiltermodel.h
torrentcontentmodel.h
torrentcontentmodelfile.h
torrentcontentmodelfolder.h
torrentcontentmodelitem.h
torrentcontenttreeview.h
torrentcreatordialog.h
trackerentriesdialog.h
transferlistdelegate.h
transferlistfilterswidget.h
transferlistmodel.h
transferlistsortmodel.h
transferlistwidget.h
tristateaction.h
uithememanager.h
updownratiodialog.h
utils.h
# sources
aboutdialog.cpp
addnewtorrentdialog.cpp
advancedsettings.cpp
autoexpandabledialog.cpp
banlistoptionsdialog.cpp
categoryfiltermodel.cpp
categoryfilterproxymodel.cpp
categoryfilterwidget.cpp
cookiesdialog.cpp
cookiesmodel.cpp
deletionconfirmationdialog.cpp
downloadfromurldialog.cpp
executionlogwidget.cpp
fspathedit.cpp
hidabletabwidget.cpp
ipsubnetwhitelistoptionsdialog.cpp
lineedit.cpp
mainwindow.cpp
optionsdialog.cpp
previewlistdelegate.cpp
previewselectdialog.cpp
private/fspathedit_p.cpp
private/tristatewidget.cpp
raisedmessagebox.cpp
scanfoldersdelegate.cpp
shutdownconfirmdialog.cpp
speedlimitdialog.cpp
statsdialog.cpp
statusbar.cpp
tagfiltermodel.cpp
tagfilterproxymodel.cpp
tagfilterwidget.cpp
torrentcategorydialog.cpp
torrentcontentfiltermodel.cpp
torrentcontentmodel.cpp
torrentcontentmodelfile.cpp
torrentcontentmodelfolder.cpp
torrentcontentmodelitem.cpp
torrentcontenttreeview.cpp
torrentcreatordialog.cpp
trackerentriesdialog.cpp
transferlistdelegate.cpp
transferlistfilterswidget.cpp
transferlistmodel.cpp
transferlistsortmodel.cpp
transferlistwidget.cpp
tristateaction.cpp
uithememanager.cpp
updownratiodialog.cpp
utils.cpp
# forms
aboutdialog.ui
addnewtorrentdialog.ui
autoexpandabledialog.ui
banlistoptionsdialog.ui
cookiesdialog.ui
deletionconfirmationdialog.ui
downloadfromurldialog.ui
executionlogwidget.ui
ipsubnetwhitelistoptionsdialog.ui
mainwindow.ui
optionsdialog.ui
previewselectdialog.ui
shutdownconfirmdialog.ui
speedlimitdialog.ui
statsdialog.ui
torrentcategorydialog.ui
torrentcreatordialog.ui
trackerentriesdialog.ui
updownratiodialog.ui
# resources
about.qrc
)
if (WIN32 OR APPLE)
target_sources(qbt_gui PRIVATE programupdater.h programupdater.cpp)
endif()
add_subdirectory(log)
add_subdirectory(properties) add_subdirectory(properties)
add_subdirectory(powermanagement) add_subdirectory(powermanagement)
add_subdirectory(rss) add_subdirectory(rss)
add_subdirectory(search) add_subdirectory(search)
add_library(qbt_gui STATIC if (UNIX AND Qt5DBus_FOUND)
# headers add_subdirectory(qtnotify)
aboutdialog.h target_link_libraries(qbt_gui PRIVATE Qt5::DBus)
addnewtorrentdialog.h endif()
advancedsettings.h
autoexpandabledialog.h
banlistoptionsdialog.h
categoryfiltermodel.h
categoryfilterproxymodel.h
categoryfilterwidget.h
cookiesdialog.h
cookiesmodel.h
deletionconfirmationdialog.h
downloadfromurldialog.h
executionlogwidget.h
fspathedit.h
hidabletabwidget.h
ipsubnetwhitelistoptionsdialog.h
lineedit.h
log/logfiltermodel.h
log/loglistview.h
log/logmodel.h
mainwindow.h
optionsdialog.h
previewlistdelegate.h
previewselectdialog.h
private/fspathedit_p.h
private/tristatewidget.h
raisedmessagebox.h
scanfoldersdelegate.h
shutdownconfirmdialog.h
speedlimitdialog.h
statsdialog.h
statusbar.h
tagfiltermodel.h
tagfilterproxymodel.h
tagfilterwidget.h
torrentcategorydialog.h
torrentcontentfiltermodel.h
torrentcontentmodel.h
torrentcontentmodelfile.h
torrentcontentmodelfolder.h
torrentcontentmodelitem.h
torrentcontenttreeview.h
torrentcreatordialog.h
trackerentriesdialog.h
transferlistdelegate.h
transferlistfilterswidget.h
transferlistmodel.h
transferlistsortmodel.h
transferlistwidget.h
tristateaction.h
uithememanager.h
updownratiodialog.h
utils.h
# sources
aboutdialog.cpp
addnewtorrentdialog.cpp
advancedsettings.cpp
autoexpandabledialog.cpp
banlistoptionsdialog.cpp
categoryfiltermodel.cpp
categoryfilterproxymodel.cpp
categoryfilterwidget.cpp
cookiesdialog.cpp
cookiesmodel.cpp
deletionconfirmationdialog.cpp
downloadfromurldialog.cpp
executionlogwidget.cpp
fspathedit.cpp
hidabletabwidget.cpp
ipsubnetwhitelistoptionsdialog.cpp
lineedit.cpp
log/logfiltermodel.cpp
log/loglistview.cpp
log/logmodel.cpp
mainwindow.cpp
optionsdialog.cpp
previewlistdelegate.cpp
previewselectdialog.cpp
private/fspathedit_p.cpp
private/tristatewidget.cpp
raisedmessagebox.cpp
scanfoldersdelegate.cpp
shutdownconfirmdialog.cpp
speedlimitdialog.cpp
statsdialog.cpp
statusbar.cpp
tagfiltermodel.cpp
tagfilterproxymodel.cpp
tagfilterwidget.cpp
torrentcategorydialog.cpp
torrentcontentfiltermodel.cpp
torrentcontentmodel.cpp
torrentcontentmodelfile.cpp
torrentcontentmodelfolder.cpp
torrentcontentmodelitem.cpp
torrentcontenttreeview.cpp
torrentcreatordialog.cpp
trackerentriesdialog.cpp
transferlistdelegate.cpp
transferlistfilterswidget.cpp
transferlistmodel.cpp
transferlistsortmodel.cpp
transferlistwidget.cpp
tristateaction.cpp
uithememanager.cpp
updownratiodialog.cpp
utils.cpp
# forms
aboutdialog.ui
addnewtorrentdialog.ui
autoexpandabledialog.ui
banlistoptionsdialog.ui
cookiesdialog.ui
deletionconfirmationdialog.ui
downloadfromurldialog.ui
executionlogwidget.ui
ipsubnetwhitelistoptionsdialog.ui
mainwindow.ui
optionsdialog.ui
previewselectdialog.ui
shutdownconfirmdialog.ui
speedlimitdialog.ui
statsdialog.ui
torrentcategorydialog.ui
torrentcreatordialog.ui
trackerentriesdialog.ui
updownratiodialog.ui
)
target_link_libraries(qbt_gui target_link_libraries(qbt_gui
PRIVATE PRIVATE
qbt_powermanagement qbt_rss qbt_properties qbt_searchengine
qbt_base qbt_base
PUBLIC
Qt5::Gui Qt5::Widgets
) )
target_include_directories(qbt_gui
PRIVATE ../app
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
)
if (UNIX AND Qt5DBus_FOUND)
add_subdirectory(qtnotify)
target_link_libraries(qbt_gui PRIVATE qbt_qtnotify)
endif (UNIX AND Qt5DBus_FOUND)
if (APPLE) if (APPLE)
target_sources(qbt_gui PRIVATE macutilities.h macutilities.mm) target_sources(qbt_gui PRIVATE macutilities.h macutilities.mm)
find_package(Qt5 ${requiredQtVersion} REQUIRED COMPONENTS MacExtras) find_package(Qt5 ${requiredQtVersion} REQUIRED COMPONENTS MacExtras)
target_link_libraries(qbt_gui PRIVATE Qt5::MacExtras objc) target_link_libraries(qbt_gui PRIVATE Qt5::MacExtras objc)
endif (APPLE) endif()
if (WIN32 OR APPLE)
target_sources(qbt_gui PRIVATE programupdater.h programupdater.cpp)
endif (WIN32 OR APPLE)
qbt_target_sources(qBittorrent PRIVATE about.qrc)
if(WIN32) if (WIN32)
find_package(Qt5 ${requiredQtVersion} REQUIRED COMPONENTS WinExtras) find_package(Qt5 ${requiredQtVersion} REQUIRED COMPONENTS WinExtras)
target_link_libraries(qbt_gui PRIVATE Qt5::WinExtras) target_link_libraries(qbt_gui PRIVATE Qt5::WinExtras PowrProf)
endif(WIN32) endif()

11
src/gui/log/CMakeLists.txt

@ -0,0 +1,11 @@
target_sources(qbt_gui PRIVATE
# headers
logfiltermodel.h
loglistview.h
logmodel.h
#sources
logfiltermodel.cpp
loglistview.cpp
logmodel.cpp
)

23
src/gui/powermanagement/CMakeLists.txt

@ -1,23 +1,8 @@
add_library(qbt_powermanagement STATIC target_sources(qbt_gui PRIVATE powermanagement.h powermanagement.cpp)
# headers
powermanagement.h
# sources
powermanagement.cpp
)
target_link_libraries(qbt_powermanagement PUBLIC Qt5::Core)
set_target_properties(qbt_powermanagement PROPERTIES AUTOUIC False AUTORCC False)
target_include_directories(qbt_powermanagement PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
if (UNIX AND Qt5DBus_FOUND) if (UNIX AND Qt5DBus_FOUND)
find_package(X11) find_package(X11)
if (X11_FOUND) if (X11_FOUND)
target_sources(qbt_powermanagement PRIVATE powermanagement_x11.h powermanagement_x11.cpp) target_sources(qbt_gui PRIVATE powermanagement_x11.h powermanagement_x11.cpp)
target_link_libraries(qbt_powermanagement PRIVATE Qt5::DBus) endif()
endif (X11_FOUND) endif()
endif (UNIX AND Qt5DBus_FOUND)
if (WIN32)
target_link_libraries(qbt_powermanagement PRIVATE PowrProf)
endif (WIN32)

84
src/gui/properties/CMakeLists.txt

@ -1,52 +1,38 @@
add_library(qbt_properties STATIC target_sources(qbt_gui PRIVATE
# headers # headers
downloadedpiecesbar.h downloadedpiecesbar.h
peerlistdelegate.h peerlistdelegate.h
peerlistsortmodel.h peerlistsortmodel.h
peerlistwidget.h peerlistwidget.h
peersadditiondialog.h peersadditiondialog.h
pieceavailabilitybar.h pieceavailabilitybar.h
piecesbar.h piecesbar.h
propertieswidget.h propertieswidget.h
proplistdelegate.h proplistdelegate.h
proptabbar.h proptabbar.h
speedplotview.h speedplotview.h
speedwidget.h speedwidget.h
trackerlistwidget.h trackerlistwidget.h
trackersadditiondialog.h trackersadditiondialog.h
# sources # sources
downloadedpiecesbar.cpp downloadedpiecesbar.cpp
peerlistdelegate.cpp peerlistdelegate.cpp
peerlistsortmodel.cpp peerlistsortmodel.cpp
peerlistwidget.cpp peerlistwidget.cpp
peersadditiondialog.cpp peersadditiondialog.cpp
pieceavailabilitybar.cpp pieceavailabilitybar.cpp
piecesbar.cpp piecesbar.cpp
propertieswidget.cpp propertieswidget.cpp
proplistdelegate.cpp proplistdelegate.cpp
proptabbar.cpp proptabbar.cpp
speedplotview.cpp speedplotview.cpp
speedwidget.cpp speedwidget.cpp
trackerlistwidget.cpp trackerlistwidget.cpp
trackersadditiondialog.cpp trackersadditiondialog.cpp
# forms # forms
peersadditiondialog.ui peersadditiondialog.ui
propertieswidget.ui propertieswidget.ui
trackersadditiondialog.ui trackersadditiondialog.ui
)
target_link_libraries(qbt_properties
PRIVATE
qbt_gui_headers
PUBLIC
qbt_base Qt5::Widgets
)
target_include_directories(qbt_properties
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
) )

12
src/gui/qtnotify/CMakeLists.txt

@ -1,11 +1 @@
add_library(qbt_qtnotify STATIC target_sources(qbt_gui PRIVATE notifications.h notifications.cpp)
# headers
notifications.h
# sources
notifications.cpp
)
set_target_properties(qbt_qtnotify PROPERTIES AUTOUIC False AUTORCC False)
target_link_libraries(qbt_qtnotify PUBLIC Qt5::DBus)
target_include_directories(qbt_qtnotify PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

40
src/gui/rss/CMakeLists.txt

@ -1,27 +1,19 @@
add_library(qbt_rss STATIC target_sources(qbt_gui PRIVATE
# headers # headers
articlelistwidget.h articlelistwidget.h
automatedrssdownloader.h automatedrssdownloader.h
feedlistwidget.h feedlistwidget.h
htmlbrowser.h htmlbrowser.h
rsswidget.h rsswidget.h
#sources #sources
articlelistwidget.cpp articlelistwidget.cpp
automatedrssdownloader.cpp automatedrssdownloader.cpp
feedlistwidget.cpp feedlistwidget.cpp
htmlbrowser.cpp htmlbrowser.cpp
rsswidget.cpp rsswidget.cpp
# forms # forms
automatedrssdownloader.ui automatedrssdownloader.ui
rsswidget.ui rsswidget.ui
)
target_include_directories(qbt_rss PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(qbt_rss
PRIVATE
qbt_gui_headers
PUBLIC
qbt_base Qt5::Gui Qt5::Widgets Qt5::Network
) )

49
src/gui/search/CMakeLists.txt

@ -1,33 +1,22 @@
add_library(qbt_searchengine STATIC target_sources(qbt_gui PRIVATE
# headers # headers
pluginselectdialog.h pluginselectdialog.h
pluginsourcedialog.h pluginsourcedialog.h
searchjobwidget.h searchjobwidget.h
searchlistdelegate.h searchlistdelegate.h
searchsortmodel.h searchsortmodel.h
searchwidget.h searchwidget.h
# sources # sources
pluginselectdialog.cpp pluginselectdialog.cpp
pluginsourcedialog.cpp pluginsourcedialog.cpp
searchjobwidget.cpp searchjobwidget.cpp
searchlistdelegate.cpp searchlistdelegate.cpp
searchsortmodel.cpp searchsortmodel.cpp
searchwidget.cpp searchwidget.cpp
# forms # forms
pluginselectdialog.ui pluginselectdialog.ui
pluginsourcedialog.ui pluginsourcedialog.ui
searchwidget.ui searchwidget.ui
)
set(QBT_SEARCHENGINE_RESOURCES
# search.qrc
)
target_link_libraries(qbt_searchengine
PUBLIC
qbt_base
PRIVATE
qbt_gui_headers
) )

Loading…
Cancel
Save