1 cmake_minimum_required(VERSION 3.16 FATAL_ERROR) # Policies <= CMP0097 default to NEW
3 list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)
7 DESCRIPTION "The qBittorrent BitTorrent client"
8 HOMEPAGE_URL "https://www.qbittorrent.org/"
12 # use CONFIG mode first in find_package
13 set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
14 # version requirements
15 set(requiredBoostVersion 1.40)
16 set(requiredQtVersion 5.9.0)
17 set(requiredOpenSSLVersion 1.0)
18 set(requiredLibtorrentVersion 1.2.0)
19 set(requiredZlibVersion 1.2.5.2)
21 # features (some are platform-specific)
22 include(FeatureSummary)
23 include(FeatureOptionsSetup)
24 feature_option(STACKTRACE "Enable stacktraces" ON)
25 feature_option(GUI "Build GUI application" ON)
26 feature_option(WEBUI "Enables built-in HTTP server for headless use" ON)
27 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)
28 if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
29 feature_option_dependent(DBUS
30 "Enables support for notifications and power-management features on Linux via D-Bus"
33 feature_option_dependent(SYSTEMD
34 "Install systemd service file to a directory manually overridable with Systemd_SERVICES_INSTALL_DIR"
38 feature_option(MSVC_RUNTIME_DYNAMIC "Use MSVC dynamic runtime library (-MD) instead of static (-MT)" ON)
41 set(QBT_VER_STATUS "alpha1" CACHE STRING "Project status version. Should be empty for release builds.")
43 include(GNUInstallDirs)
45 add_subdirectory(dist)
47 if (VERBOSE_CONFIGURE)
48 feature_summary(WHAT ALL)
50 feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES)