File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ before_install:
9494 - |
9595 if [ "$gui" = "false" ]; then
9696 qmake_conf="$qmake_conf --disable-gui"
97- cmake_conf="$cmake_conf -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Widgets=ON "
97+ cmake_conf="$cmake_conf -DGUI=OFF "
9898 fi
9999
100100 # print settings
Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ optional_compile_definitions(COUNTRIES_RESOLUTION FEATURE DESCRIPTION "Enable re
5757 DEFAULT ON DISABLED DISABLE_COUNTRIES_RESOLUTION )
5858optional_compile_definitions (STACKTRACE FEATURE DESCRIPTION "Enable stacktraces"
5959 DEFAULT ON ENABLED STACKTRACE )
60+ optional_compile_definitions (GUI FEATURE DESCRIPTION "Build GUI application"
61+ DEFAULT ON DISABLED DISABLE_GUI )
6062optional_compile_definitions (WEBUI FEATURE DESCRIPTION "Enables built-in HTTP server for headless use"
6163 DEFAULT ON DISABLED DISABLE_WEBUI )
6264
Original file line number Diff line number Diff line change @@ -12,19 +12,13 @@ if (Boost_VERSION VERSION_LESS 106000)
1212endif ()
1313
1414find_package (Qt5 ${requiredQtVersion} REQUIRED COMPONENTS Core Network Xml LinguistTools )
15- find_package ( Qt5Widgets ${requiredQtVersion} )
16- if (Qt5Widgets_FOUND )
15+ if ( NOT DISABLE_GUI )
16+ find_package ( Qt5Widgets ${requiredQtVersion} REQUIRED )
1717 find_package (Qt5DBus ${requiredQtVersion} )
1818else ()
1919 add_definitions (-DDISABLE_GUI )
2020endif ()
2121
22- set_package_properties (Qt5Widgets PROPERTIES
23- DESCRIPTION "Set of components for creating classic desktop-style UIs for the Qt5 framework"
24- PURPOSE "Enables qBittorrent GUI. Unneeded for headless configuration."
25- TYPE OPTIONAL
26- )
27-
2822set_package_properties (Qt5DBus PROPERTIES
2923 DESCRIPTION "Qt5 module for inter-process communication over the D-Bus protocol"
3024 PURPOSE "Enables communication with other system components (e.g. notification service) via D-Bus. "
@@ -60,7 +54,7 @@ configure_file(config.h.cmakein ${CMAKE_CURRENT_BINARY_DIR}/config.h)
6054add_subdirectory (app )
6155add_subdirectory (base )
6256
63- if (Qt5Widgets_FOUND )
57+ if (NOT DISABLE_GUI )
6458 add_subdirectory (gui )
6559endif ()
6660
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ if (STACKTRACE)
6363 target_sources (qBittorrent PRIVATE stacktrace.h )
6464 else ()
6565 target_sources (qBittorrent PRIVATE stacktrace_win.h )
66- if (Qt5Widgets_FOUND )
66+ if (NOT DISABLE_GUI )
6767 target_sources (qBittorrent PRIVATE stacktracedialog.cpp stacktracedialog.h )
6868 endif ()
6969
@@ -85,7 +85,7 @@ if (STACKTRACE)
8585 endif ()
8686endif ()
8787
88- if (Qt5Widgets_FOUND )
88+ if (NOT DISABLE_GUI )
8989 target_link_libraries (qBittorrent PRIVATE qbt_gui )
9090 set_target_properties (qBittorrent
9191 PROPERTIES
@@ -156,7 +156,7 @@ install(TARGETS qBittorrent
156156 COMPONENT runtime
157157)
158158
159- if (Qt5Widgets_FOUND AND APPLE )
159+ if (NOT DISABLE_GUI AND APPLE )
160160 find_package (Qt5Svg REQUIRED )
161161 include (bundle )
162162endif ()
You can’t perform that action at this time.
0 commit comments