2020-05-03 18:28:07 +00:00
cmake_minimum_required ( VERSION 3.16 FATAL_ERROR ) # Policies <= CMP0097 default to NEW
2020-04-30 09:31:23 +00:00
2020-05-03 18:28:07 +00:00
project ( qBittorrent
D E S C R I P T I O N " T h e q B i t t o r r e n t B i t T o r r e n t c l i e n t "
H O M E P A G E _ U R L " h t t p s : / / w w w . q b i t t o r r e n t . o r g / "
L A N G U A G E S C X X
)
2018-06-05 01:03:38 +00:00
2021-08-21 13:43:50 +00:00
# version requirements - older versions may work, but you are on your own
2022-05-06 03:20:34 +00:00
set ( minBoostVersion 1.71 )
2021-03-01 05:38:51 +00:00
set ( minQt5Version 5.15.2 )
set ( minQt6Version 6.2 )
2020-12-04 12:16:04 +00:00
set ( minOpenSSLVersion 1.1.1 )
2022-10-30 05:30:31 +00:00
set ( minLibtorrent1Version 1.2.18 )
set ( minLibtorrentVersion 2.0.8 )
2020-12-04 12:16:04 +00:00
set ( minZlibVersion 1.2.11 )
2015-11-06 18:03:18 +00:00
2020-12-06 19:17:58 +00:00
include ( CheckCXXSourceCompiles ) # TODO: migrate to CheckSourceCompiles in CMake >= 3.19
2022-07-10 05:20:27 +00:00
include ( GNUInstallDirs )
list ( APPEND CMAKE_MODULE_PATH ${ CMAKE_CURRENT_SOURCE_DIR } /cmake/Modules )
2020-05-03 18:28:07 +00:00
include ( FeatureSummary )
include ( FeatureOptionsSetup )
2022-07-10 05:20:27 +00:00
# features, list is loosely sorted by user's interests
2020-05-03 18:28:07 +00:00
feature_option ( GUI "Build GUI application" ON )
2022-07-10 05:20:27 +00:00
feature_option ( WEBUI "Enable built-in HTTP server for remote control" ON )
feature_option ( QT6 "Build with Qt 6 instead of Qt 5" OFF )
feature_option ( STACKTRACE "Enable stacktrace support" ON )
feature_option ( TESTING "Build internal testing suite" OFF )
2020-05-03 18:28:07 +00:00
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 )
2022-07-10 05:20:27 +00:00
2020-05-03 18:28:07 +00:00
if ( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
feature_option_dependent ( DBUS
2022-07-10 05:20:27 +00:00
" E n a b l e s u p p o r t f o r n o t i f i c a t i o n s a n d p o w e r - m a n a g e m e n t f e a t u r e s v i a D - B u s o n L i n u x "
2020-05-03 18:28:07 +00:00
O N " G U I " O F F
)
feature_option_dependent ( SYSTEMD
2022-07-10 05:20:27 +00:00
" I n s t a l l s y s t e m d s e r v i c e f i l e . T a r g e t d i r e c t o r y i s o v e r r i d a b l e w i t h ` S Y S T E M D _ S E R V I C E S _ I N S T A L L _ D I R ` v a r i a b l e "
2020-05-03 18:28:07 +00:00
O F F " N O T G U I " O F F
)
elseif ( MSVC )
2020-09-26 18:32:56 +00:00
feature_option ( MSVC_RUNTIME_DYNAMIC "Use MSVC dynamic runtime library (-MD) instead of static (-MT)" ON )
2020-04-30 08:34:41 +00:00
endif ( )
2015-11-06 18:03:18 +00:00
2020-05-03 18:28:07 +00:00
if ( VERBOSE_CONFIGURE )
feature_summary ( WHAT ALL )
else ( )
feature_summary ( WHAT ENABLED_FEATURES DISABLED_FEATURES )
endif ( )
2021-01-06 18:07:10 +00:00
2022-07-10 05:20:27 +00:00
# go check the packages
include ( CheckPackages )
# configure for specific platform
include ( CommonConfig )
2021-01-06 18:07:10 +00:00
# Generate version header
2021-02-05 02:14:52 +00:00
configure_file ( "src/base/version.h.in" "${CMAKE_CURRENT_SOURCE_DIR}/src/base/version.h" @ONLY )
2022-07-10 05:20:27 +00:00
add_subdirectory ( src )
add_subdirectory ( dist )
if ( TESTING )
add_subdirectory ( test )
endif ( )