mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 13:23:34 -07:00
CMake: Fix optional features handling
This commit is contained in:
parent
bc05f3f76b
commit
a22f921941
2 changed files with 8 additions and 10 deletions
|
@ -12,11 +12,9 @@ if (Boost_VERSION VERSION_LESS 106000)
|
|||
endif()
|
||||
|
||||
find_package(Qt5 ${requiredQtVersion} REQUIRED COMPONENTS Core Network Xml LinguistTools)
|
||||
if (NOT DISABLE_GUI)
|
||||
if (GUI)
|
||||
find_package(Qt5Widgets ${requiredQtVersion} REQUIRED)
|
||||
find_package(Qt5DBus ${requiredQtVersion})
|
||||
else()
|
||||
add_definitions(-DDISABLE_GUI)
|
||||
endif()
|
||||
|
||||
set_package_properties(Qt5DBus PROPERTIES
|
||||
|
@ -54,10 +52,10 @@ configure_file(config.h.cmakein ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
|||
add_subdirectory(app)
|
||||
add_subdirectory(base)
|
||||
|
||||
if (NOT DISABLE_GUI)
|
||||
if (GUI)
|
||||
add_subdirectory(gui)
|
||||
endif ()
|
||||
|
||||
if (NOT DISABLE_WEBUI)
|
||||
if (WEBUI)
|
||||
add_subdirectory(webui)
|
||||
endif()
|
||||
|
|
|
@ -34,7 +34,7 @@ include(QbtTranslations)
|
|||
file(GLOB QBT_TS_FILES ../lang/*.ts)
|
||||
qbt_add_translations(qBittorrent QRC_FILE "../lang/lang.qrc" TS_FILES ${QBT_TS_FILES})
|
||||
|
||||
if (NOT DISABLE_WEBUI)
|
||||
if (WEBUI)
|
||||
file(GLOB QBT_WEBUI_TS_FILES ../webui/www/translations/*.ts)
|
||||
qbt_add_translations(qBittorrent QRC_FILE "../webui/www/translations/webui_translations.qrc" TS_FILES ${QBT_WEBUI_TS_FILES})
|
||||
endif()
|
||||
|
@ -63,7 +63,7 @@ if (STACKTRACE)
|
|||
target_sources(qBittorrent PRIVATE stacktrace.h)
|
||||
else()
|
||||
target_sources(qBittorrent PRIVATE stacktrace_win.h)
|
||||
if (NOT DISABLE_GUI)
|
||||
if (GUI)
|
||||
target_sources(qBittorrent PRIVATE stacktracedialog.cpp stacktracedialog.h)
|
||||
endif()
|
||||
|
||||
|
@ -85,7 +85,7 @@ if (STACKTRACE)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT DISABLE_GUI)
|
||||
if (GUI)
|
||||
target_link_libraries(qBittorrent PRIVATE qbt_gui)
|
||||
set_target_properties(qBittorrent
|
||||
PROPERTIES
|
||||
|
@ -99,7 +99,7 @@ else()
|
|||
)
|
||||
endif()
|
||||
|
||||
if (NOT DISABLE_WEBUI)
|
||||
if (WEBUI)
|
||||
target_link_libraries(qBittorrent PRIVATE qbt_webui)
|
||||
endif()
|
||||
|
||||
|
@ -156,7 +156,7 @@ install(TARGETS qBittorrent
|
|||
COMPONENT runtime
|
||||
)
|
||||
|
||||
if (NOT DISABLE_GUI AND APPLE)
|
||||
if (GUI AND APPLE)
|
||||
find_package(Qt5Svg REQUIRED)
|
||||
include(bundle)
|
||||
endif()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue