mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 22:47:21 -06:00
Refactor CMake build scripts
1. Use FeatureSummary module to show configuration results. 2. Invert option()/find_package() relationship: instead of calling find_package(... REQUIRED) when option is set, rely on optional find package call and PackageName_FOUND variable. 3. Refactor handling options that result in simple preprocessor defines (actually copy the snippet from libtorrent) so that everything is done in a single function call. 4. Populate target properties in order to get rid of include_directories() calls.
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user