mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-23 16:58:06 -06:00
@@ -1,7 +1,8 @@
|
||||
set(CMAKE_AUTORCC True)
|
||||
set(CMAKE_AUTOUIC True)
|
||||
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
add_library(qbt_gui_headers INTERFACE)
|
||||
target_include_directories(qbt_gui_headers INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
add_subdirectory(lineedit)
|
||||
add_subdirectory(properties)
|
||||
@@ -9,24 +10,8 @@ add_subdirectory(powermanagement)
|
||||
add_subdirectory(rss)
|
||||
add_subdirectory(search)
|
||||
|
||||
if (UNIX AND NOT APPLE AND DBUS)
|
||||
add_subdirectory(qtnotify)
|
||||
include_directories(qtnotify)
|
||||
list(APPEND QBT_GUI_OPTIONAL_LINK_LIBRARIES qbt_qtnotify)
|
||||
endif (UNIX AND NOT APPLE AND DBUS)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/properties
|
||||
${CMAKE_CURRENT_BINARY_DIR}/rss
|
||||
${CMAKE_CURRENT_BINARY_DIR}/search
|
||||
lineedit/src
|
||||
powermanagement
|
||||
properties
|
||||
rss
|
||||
../app
|
||||
)
|
||||
|
||||
set(QBT_GUI_HEADERS
|
||||
add_library(qbt_gui STATIC
|
||||
# headers
|
||||
about_imp.h
|
||||
addnewtorrentdialog.h
|
||||
advancedsettings.h
|
||||
@@ -75,9 +60,7 @@ transferlistsortmodel.h
|
||||
transferlistwidget.h
|
||||
updownratiodlg.h
|
||||
utils.h
|
||||
)
|
||||
|
||||
set(QBT_GUI_SOURCES
|
||||
# sources
|
||||
addnewtorrentdialog.cpp
|
||||
advancedsettings.cpp
|
||||
autoexpandabledialog.cpp
|
||||
@@ -122,19 +105,7 @@ transferlistsortmodel.cpp
|
||||
transferlistwidget.cpp
|
||||
updownratiodlg.cpp
|
||||
utils.cpp
|
||||
)
|
||||
|
||||
if (APPLE)
|
||||
list(APPEND QBT_GUI_HEADERS macutilities.h)
|
||||
list(APPEND QBT_GUI_SOURCES macutilities.mm)
|
||||
endif (APPLE)
|
||||
|
||||
if (WIN32 OR APPLE)
|
||||
list(APPEND QBT_GUI_HEADERS programupdater.h)
|
||||
list(APPEND QBT_GUI_SOURCES programupdater.cpp)
|
||||
endif (WIN32 OR APPLE)
|
||||
|
||||
set(QBT_GUI_FORMS
|
||||
# forms
|
||||
mainwindow.ui
|
||||
about.ui
|
||||
banlistoptions.ui
|
||||
@@ -156,17 +127,36 @@ torrentcreatordlg.ui
|
||||
shutdownconfirmdlg.ui
|
||||
)
|
||||
|
||||
qbt_target_sources(about.qrc)
|
||||
|
||||
add_library(qbt_gui STATIC ${QBT_GUI_HEADERS} ${QBT_GUI_SOURCES} ${QBT_GUI_FORMS})
|
||||
target_link_libraries(qbt_gui qbt_lineedit qbt_powermanagement qbt_rss qbt_properties qbt_searchengine
|
||||
${QBT_GUI_OPTIONAL_LINK_LIBRARIES} qbt_base
|
||||
QtSingleApplication::QtSingleApplication
|
||||
target_link_libraries(qbt_gui
|
||||
PRIVATE
|
||||
qbt_lineedit qbt_powermanagement qbt_rss qbt_properties qbt_searchengine
|
||||
qbt_base
|
||||
QtSingleApplication::QtSingleApplication
|
||||
)
|
||||
if(WIN32)
|
||||
target_link_libraries(qbt_gui Qt5::WinExtras)
|
||||
endif(WIN32)
|
||||
|
||||
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)
|
||||
target_link_libraries(qbt_gui Qt5::MacExtras)
|
||||
endif()
|
||||
target_sources(qbt_gui PRIVATE macutilities.h macutilities.mm)
|
||||
find_package(Qt5 ${requiredQtVersion} REQUIRED COMPONENTS MacExtras)
|
||||
target_link_libraries(qbt_gui PRIVATE Qt5::MacExtras objc)
|
||||
endif (APPLE)
|
||||
|
||||
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)
|
||||
find_package(Qt5 ${requiredQtVersion} REQUIRED COMPONENTS WinExtras)
|
||||
target_link_libraries(qbt_gui PRIVATE Qt5::WinExtras)
|
||||
endif(WIN32)
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
set(QBT_LINEEDIT_SOURCES
|
||||
add_library(qbt_lineedit STATIC
|
||||
src/lineedit.cpp
|
||||
)
|
||||
|
||||
set(QBT_LINEEDIT_HEADERS
|
||||
src/lineedit.h
|
||||
)
|
||||
|
||||
add_library(qbt_lineedit STATIC ${QBT_LINEEDIT_SOURCES} ${QBT_LINEEDIT_HEADERS})
|
||||
target_link_libraries(qbt_lineedit Qt5::Widgets)
|
||||
target_link_libraries(qbt_lineedit
|
||||
PRIVATE
|
||||
qbt_gui_headers
|
||||
PUBLIC
|
||||
Qt5::Widgets
|
||||
)
|
||||
|
||||
target_include_directories(qbt_lineedit PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||
|
||||
@@ -1,25 +1,20 @@
|
||||
set(QBT_POWERMANAGEMENT_HEADERS
|
||||
add_library(qbt_powermanagement STATIC
|
||||
powermanagement.h
|
||||
)
|
||||
|
||||
set(QBT_POWERMANAGEMENT_SOURCES
|
||||
powermanagement.cpp
|
||||
)
|
||||
|
||||
if (UNIX AND DBUS)
|
||||
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)
|
||||
find_package(X11)
|
||||
if (X11_FOUND)
|
||||
list(APPEND QBT_POWERMANAGEMENT_HEADERS powermanagement_x11.h)
|
||||
list(APPEND QBT_POWERMANAGEMENT_SOURCES powermanagement_x11.cpp)
|
||||
target_sources(qbt_powermanagement PRIVATE powermanagement_x11.h powermanagement_x11.cpp)
|
||||
target_link_libraries(qbt_powermanagement PRIVATE Qt5::DBus)
|
||||
endif (X11_FOUND)
|
||||
endif (UNIX AND DBUS)
|
||||
endif (UNIX AND Qt5DBus_FOUND)
|
||||
|
||||
add_library(qbt_powermanagement STATIC ${QBT_POWERMANAGEMENT_SOURCES} ${QBT_POWERMANAGEMENT_HEADERS})
|
||||
set_target_properties(qbt_powermanagement PROPERTIES AUTOUIC False AUTORCC False)
|
||||
target_link_qt_components(qbt_powermanagement Core)
|
||||
if (X11_FOUND)
|
||||
target_link_qt_components(qbt_powermanagement DBus)
|
||||
endif (X11_FOUND)
|
||||
if (WIN32)
|
||||
target_link_libraries(qbt_powermanagement PowrProf)
|
||||
target_link_libraries(qbt_powermanagement PRIVATE PowrProf)
|
||||
endif (WIN32)
|
||||
|
||||
@@ -1,16 +1,7 @@
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
../lineedit/src/
|
||||
)
|
||||
|
||||
set(QBT_PROPERTIES_FORMS
|
||||
add_library(qbt_properties STATIC
|
||||
propertieswidget.ui
|
||||
trackersadditiondlg.ui
|
||||
peersadditiondlg.ui
|
||||
)
|
||||
|
||||
set(QBT_PROPERTIES_HEADERS
|
||||
propertieswidget.h
|
||||
peerlistwidget.h
|
||||
proplistdelegate.h
|
||||
@@ -25,9 +16,6 @@ pieceavailabilitybar.h
|
||||
proptabbar.h
|
||||
speedwidget.h
|
||||
speedplotview.h
|
||||
)
|
||||
|
||||
set(QBT_PROPERTIES_SOURCES
|
||||
propertieswidget.cpp
|
||||
proplistdelegate.cpp
|
||||
peerlistwidget.cpp
|
||||
@@ -42,6 +30,16 @@ speedwidget.cpp
|
||||
speedplotview.cpp
|
||||
)
|
||||
|
||||
add_library(qbt_properties STATIC ${QBT_PROPERTIES_HEADERS} ${QBT_PROPERTIES_SOURCES} ${QBT_PROPERTIES_FORMS})
|
||||
target_link_libraries(qbt_properties qbt_base)
|
||||
target_link_libraries(qbt_properties Qt5::Widgets)
|
||||
target_link_libraries(qbt_properties
|
||||
PRIVATE
|
||||
qbt_gui_headers
|
||||
PUBLIC
|
||||
qbt_base qbt_lineedit Qt5::Widgets
|
||||
)
|
||||
|
||||
target_include_directories(qbt_properties
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
set(QBT_QTNOTIFY_SOURCES
|
||||
add_library(qbt_qtnotify STATIC
|
||||
notifications.cpp
|
||||
)
|
||||
|
||||
set(QBT_QTNOTIFY_HEADERS
|
||||
notifications.h
|
||||
)
|
||||
|
||||
add_library(qbt_qtnotify STATIC ${QBT_QTNOTIFY_SOURCES} ${QBT_QTNOTIFY_HEADERS})
|
||||
set_target_properties(qbt_qtnotify PROPERTIES AUTOUIC False AUTORCC False)
|
||||
target_link_qt_components(qbt_qtnotify DBus)
|
||||
target_link_libraries(qbt_qtnotify PUBLIC Qt5::DBus)
|
||||
target_include_directories(qbt_qtnotify PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
@@ -1,26 +1,22 @@
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
set(QBT_RSS_HEADERS
|
||||
add_library(qbt_rss STATIC
|
||||
articlelistwidget.h
|
||||
automatedrssdownloader.h
|
||||
feedlistwidget.h
|
||||
htmlbrowser.h
|
||||
rsswidget.h
|
||||
)
|
||||
|
||||
set(QBT_RSS_SOURCE
|
||||
articlelistwidget.cpp
|
||||
automatedrssdownloader.cpp
|
||||
feedlistwidget.cpp
|
||||
htmlbrowser.cpp
|
||||
rsswidget.cpp
|
||||
)
|
||||
|
||||
set(QBT_RSS_FORMS
|
||||
automatedrssdownloader.ui
|
||||
rsswidget.ui
|
||||
)
|
||||
|
||||
add_library(qbt_rss STATIC ${QBT_RSS_HEADERS} ${QBT_RSS_SOURCE} ${QBT_RSS_FORMS})
|
||||
target_link_libraries(qbt_rss qbt_base)
|
||||
target_link_libraries(qbt_rss Qt5::Gui Qt5::Widgets Qt5::Network)
|
||||
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
|
||||
)
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/..
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../lineedit/src
|
||||
)
|
||||
|
||||
set(QBT_SEARCHENGINE_FORMS
|
||||
add_library(qbt_searchengine STATIC
|
||||
pluginselectdlg.ui
|
||||
pluginsourcedlg.ui
|
||||
searchwidget.ui
|
||||
)
|
||||
|
||||
set(QBT_SEARCHENGINE_HEADERS
|
||||
pluginselectdlg.h
|
||||
pluginsourcedlg.h
|
||||
searchlistdelegate.h
|
||||
searchsortmodel.h
|
||||
searchtab.h
|
||||
searchwidget.h
|
||||
)
|
||||
|
||||
set(QBT_SEARCHENGINE_SOURCES
|
||||
pluginselectdlg.cpp
|
||||
pluginsourcedlg.cpp
|
||||
searchlistdelegate.cpp
|
||||
@@ -32,6 +20,9 @@ set(QBT_SEARCHENGINE_RESOURCES
|
||||
# search.qrc
|
||||
)
|
||||
|
||||
add_library(qbt_searchengine STATIC ${QBT_SEARCHENGINE_HEADERS} ${QBT_SEARCHENGINE_SOURCES} ${QBT_SEARCHENGINE_RESOURCES} ${QBT_SEARCHENGINE_FORMS})
|
||||
target_link_libraries(qbt_searchengine qbt_base)
|
||||
|
||||
target_link_libraries(qbt_searchengine
|
||||
PUBLIC
|
||||
qbt_base
|
||||
PRIVATE
|
||||
qbt_lineedit qbt_gui_headers
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user