2018-06-05 09:03:38 +08:00
|
|
|
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
|
2015-11-07 02:03:18 +08:00
|
|
|
|
2018-09-21 00:26:27 +08:00
|
|
|
message(AUTHOR_WARNING "If the build fails, please try the autotools/qmake method.")
|
2018-05-05 20:52:41 +08:00
|
|
|
|
2017-02-07 01:05:35 +08:00
|
|
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)
|
|
|
|
include(FunctionReadVersion)
|
2015-11-07 02:03:18 +08:00
|
|
|
|
2017-02-07 01:05:35 +08:00
|
|
|
read_version("${CMAKE_CURRENT_SOURCE_DIR}/version.pri" VER_MAJOR VER_MINOR VER_BUGFIX VER_BUILD VER_STATUS)
|
|
|
|
# message(STATUS "Project version is: ${VER_MAJOR}.${VER_MINOR}.${VER_BUGFIX}.${VER_BUILD} (${VER_STATUS})")
|
|
|
|
|
|
|
|
project(qBittorrent VERSION ${VER_MAJOR}.${VER_MINOR}.${VER_BUGFIX}.${VER_BUILD})
|
2015-11-07 02:03:18 +08:00
|
|
|
|
|
|
|
set(PROJECT_VERSION "${VER_MAJOR}.${VER_MINOR}.${VER_BUGFIX}")
|
|
|
|
|
|
|
|
if (NOT VER_BUILD EQUAL 0)
|
|
|
|
set(PROJECT_VERSION "${PROJECT_VERSION}.${VER_BUILD}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(PROJECT_VERSION "${PROJECT_VERSION}${VER_STATUS}")
|
|
|
|
|
2017-03-03 16:58:55 +08:00
|
|
|
add_definitions(-DQBT_VERSION_MAJOR=${VER_MAJOR})
|
|
|
|
add_definitions(-DQBT_VERSION_MINOR=${VER_MINOR})
|
|
|
|
add_definitions(-DQBT_VERSION_BUGFIX=${VER_BUGFIX})
|
|
|
|
add_definitions(-DQBT_VERSION_BUILD=${VER_BUILD})
|
2015-11-07 02:03:18 +08:00
|
|
|
|
2017-03-03 16:58:55 +08:00
|
|
|
add_definitions(-DQBT_VERSION="v${PROJECT_VERSION}")
|
|
|
|
add_definitions(-DQBT_VERSION_2="${PROJECT_VERSION}")
|
2015-11-07 02:03:18 +08:00
|
|
|
|
2018-06-05 09:03:38 +08:00
|
|
|
include(GNUInstallDirs)
|
|
|
|
include(FeatureSummary)
|
|
|
|
|
|
|
|
# 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)
|
2018-11-21 21:29:10 +08:00
|
|
|
set(requiredOpensslVersion 1.0)
|
2019-01-09 20:09:36 +08:00
|
|
|
set(requiredLibtorrentVersion 1.1.10)
|
2015-11-07 02:03:18 +08:00
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
include(winconf)
|
|
|
|
endif(WIN32)
|
|
|
|
|
|
|
|
|
2018-06-05 09:03:38 +08:00
|
|
|
# we need options here, at the top level, because they are used not only in "src" subdir, but in the "dist" dir too
|
|
|
|
include(CompileFeature)
|
2015-11-07 02:03:18 +08:00
|
|
|
|
2018-06-05 09:03:38 +08:00
|
|
|
optional_compile_definitions(COUNTRIES_RESOLUTION FEATURE DESCRIPTION "Enable resolving peers IP addresses to countries"
|
|
|
|
DEFAULT ON DISABLED DISABLE_COUNTRIES_RESOLUTION)
|
|
|
|
optional_compile_definitions(STACKTRACE FEATURE DESCRIPTION "Enable stacktraces"
|
|
|
|
DEFAULT ON ENABLED STACKTRACE)
|
|
|
|
optional_compile_definitions(WEBUI FEATURE DESCRIPTION "Enables built-in HTTP server for headless use"
|
|
|
|
DEFAULT ON DISABLED DISABLE_WEBUI)
|
2015-11-07 02:03:18 +08:00
|
|
|
|
|
|
|
add_subdirectory(src)
|
|
|
|
add_subdirectory(dist)
|
2018-06-05 09:03:38 +08:00
|
|
|
|
|
|
|
feature_summary(DESCRIPTION "\nConfiguration results:" WHAT ALL)
|