1 cmake_minimum_required(VERSION 3.16 FATAL_ERROR) # Policies <= CMP0097 default to NEW
4 DESCRIPTION "The qBittorrent BitTorrent client"
5 HOMEPAGE_URL "https://www.qbittorrent.org/"
9 # version requirements - older versions may work, but you are on your own
10 set(minBoostVersion 1.76)
11 set(minQt6Version 6.5.0)
12 set(minOpenSSLVersion 3.0.2)
13 set(minLibtorrent1Version 1.2.19)
14 set(minLibtorrentVersion 2.0.10)
15 set(minZlibVersion 1.2.11)
17 include(GNUInstallDirs)
19 list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)
20 include(FeatureSummary)
21 include(FeatureOptionsSetup)
23 # features, list is loosely sorted by user's interests
24 feature_option(GUI "Build GUI application" ON)
25 feature_option(WEBUI "Enable built-in HTTP server for remote control" ON)
26 feature_option(STACKTRACE "Enable stacktrace support" ON)
27 feature_option(TESTING "Build internal testing suite" OFF)
28 feature_option(VERBOSE_CONFIGURE "Show information about PACKAGES_FOUND and PACKAGES_NOT_FOUND in the configure output (only useful for debugging the CMake build scripts)" OFF)
30 if (CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
31 feature_option_dependent(DBUS
32 "Enable support for notifications and power-management features via D-Bus"
37 if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
38 feature_option_dependent(SYSTEMD
39 "Install systemd service file. Target directory is overridable with `SYSTEMD_SERVICES_INSTALL_DIR` variable"
45 feature_option(MSVC_RUNTIME_DYNAMIC "Use MSVC dynamic runtime library (-MD) instead of static (-MT)" ON)
48 if (VERBOSE_CONFIGURE)
49 feature_summary(WHAT ALL)
51 feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES)
54 # go check the packages
55 include(CheckPackages)
56 # configure for specific platform
59 # Generate version header
60 configure_file("src/base/version.h.in" "${CMAKE_CURRENT_SOURCE_DIR}/src/base/version.h" @ONLY)
63 add_subdirectory(dist)
66 add_subdirectory(test)