2020-05-04 02:28:07 +08:00
cmake_minimum_required ( VERSION 3.16 FATAL_ERROR ) # Policies <= CMP0097 default to NEW
2020-04-30 17:31:23 +08:00
2017-02-07 01:05:35 +08:00
list ( APPEND CMAKE_MODULE_PATH ${ CMAKE_CURRENT_SOURCE_DIR } /cmake/Modules )
2015-11-07 02:03:18 +08:00
2020-05-04 02:28:07 +08:00
project ( qBittorrent
V E R S I O N 4 . 3 . 0 . 0
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 09:03:38 +08:00
2020-05-04 02:28:07 +08:00
# use CONFIG mode first in find_package
set ( CMAKE_FIND_PACKAGE_PREFER_CONFIG ON )
2018-06-05 09:03:38 +08:00
# version requirements
2019-06-21 01:53:34 +08:00
set ( requiredBoostVersion 1.40 )
2019-03-04 02:33:17 +08:00
set ( requiredQtVersion 5.9.0 )
2020-05-04 02:28:07 +08:00
set ( requiredOpenSSLVersion 1.0 )
set ( requiredLibtorrentVersion 1.2.0 )
set ( requiredZlibVersion 1.2.5.2 )
2015-11-07 02:03:18 +08:00
2020-05-04 02:28:07 +08:00
# features (some are platform-specific)
include ( FeatureSummary )
include ( FeatureOptionsSetup )
feature_option ( STACKTRACE "Enable stacktraces" ON )
feature_option ( GUI "Build GUI application" ON )
feature_option ( WEBUI "Enables built-in HTTP server for headless use" ON )
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 )
if ( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
feature_option_dependent ( DBUS
" E n a b l e s 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 o n L i n u x v i a D - B u s "
O N " G U I " O F F
)
feature_option_dependent ( SYSTEMD
" 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 o a d i r e c t o r y m a n u a l l y 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 "
O F F " N O T G U I " O F F
)
elseif ( MSVC )
feature_option ( MSVC_RUNTIME_DYNAMIC "Use MSVC dynamic runtime library (-MD) instead of static (-MT)" OFF )
2020-04-30 16:34:41 +08:00
endif ( )
2015-11-07 02:03:18 +08:00
2020-05-04 02:28:07 +08:00
set ( QBT_VER_STATUS "alpha1" CACHE STRING "Project status version. Should be empty for release builds." )
2015-11-07 02:03:18 +08:00
2020-05-04 02:28:07 +08:00
include ( GNUInstallDirs )
2015-11-07 02:03:18 +08:00
add_subdirectory ( src )
add_subdirectory ( dist )
2018-06-05 09:03:38 +08:00
2020-05-04 02:28:07 +08:00
if ( VERBOSE_CONFIGURE )
feature_summary ( WHAT ALL )
else ( )
feature_summary ( WHAT ENABLED_FEATURES DISABLED_FEATURES )
endif ( )