2017-04-27 15:35:28 +03:00
|
|
|
include(MacroQbtCompilerSettings)
|
|
|
|
qbt_set_compiler_options()
|
|
|
|
|
2016-04-17 01:55:45 +03:00
|
|
|
include(QbtTargetSources)
|
2015-11-06 21:03:18 +03:00
|
|
|
|
2018-06-05 04:03:38 +03:00
|
|
|
find_package(Boost ${requiredBoostVersion} REQUIRED)
|
2019-01-09 15:09:36 +03:00
|
|
|
find_package(LibtorrentRasterbar ${requiredLibtorrentVersion} REQUIRED)
|
2018-11-21 16:29:10 +03:00
|
|
|
find_package(OpenSSL ${requiredOpensslVersion} REQUIRED)
|
2015-11-06 21:03:18 +03:00
|
|
|
|
2020-07-16 18:27:20 +03:00
|
|
|
if (Boost_VERSION_STRING VERSION_LESS 1.60.0)
|
2018-06-05 04:03:38 +03:00
|
|
|
add_definitions(-DBOOST_NO_CXX11_RVALUE_REFERENCES)
|
|
|
|
endif()
|
|
|
|
|
2018-10-13 21:11:14 +03:00
|
|
|
find_package(Qt5 ${requiredQtVersion} REQUIRED COMPONENTS Core Network Xml LinguistTools)
|
2020-05-02 20:59:26 +03:00
|
|
|
if (GUI)
|
2020-04-30 16:37:07 +03:00
|
|
|
find_package(Qt5Widgets ${requiredQtVersion} REQUIRED)
|
2018-06-05 04:03:38 +03:00
|
|
|
find_package(Qt5DBus ${requiredQtVersion})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set_package_properties(Qt5DBus PROPERTIES
|
|
|
|
DESCRIPTION "Qt5 module for inter-process communication over the D-Bus protocol"
|
|
|
|
PURPOSE "Enables communication with other system components (e.g. notification service) via D-Bus. "
|
|
|
|
TYPE RECOMMENDED
|
|
|
|
)
|
2015-11-06 21:03:18 +03:00
|
|
|
|
|
|
|
set(CMAKE_AUTOMOC True)
|
|
|
|
list(APPEND CMAKE_AUTORCC_OPTIONS -compress 9 -threshold 5)
|
2018-06-05 04:03:38 +03:00
|
|
|
if (APPLE)
|
|
|
|
# Workaround CMake bug (autogen does not pass required parameters to moc)
|
|
|
|
# Relevant issue: https://gitlab.kitware.com/cmake/cmake/issues/18041
|
2019-09-05 15:11:33 +03:00
|
|
|
list(APPEND CMAKE_AUTOMOC_MOC_OPTIONS -DQ_OS_MACOS -DQ_OS_DARWIN)
|
2020-04-30 11:34:41 +03:00
|
|
|
endif()
|
2015-11-06 21:03:18 +03:00
|
|
|
|
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
|
|
|
|
# defines
|
2019-02-27 10:14:38 +03:00
|
|
|
add_definitions(-DQT_DEPRECATED_WARNINGS)
|
2015-11-06 21:03:18 +03:00
|
|
|
add_definitions(-DQT_NO_CAST_TO_ASCII)
|
2020-06-23 13:40:10 +03:00
|
|
|
add_definitions(-DQT_NO_CAST_FROM_BYTEARRAY)
|
2017-08-28 08:02:46 +03:00
|
|
|
add_definitions(-DQT_USE_QSTRINGBUILDER)
|
2019-02-27 10:14:38 +03:00
|
|
|
add_definitions(-DQT_STRICT_ITERATORS)
|
2015-11-06 21:03:18 +03:00
|
|
|
|
2018-06-05 04:03:38 +03:00
|
|
|
if (CMAKE_BUILD_TYPE MATCHES "Debug")
|
2015-11-06 21:03:18 +03:00
|
|
|
message(STATUS "Project is built in DEBUG mode.")
|
2018-06-05 04:03:38 +03:00
|
|
|
else()
|
2015-11-06 21:03:18 +03:00
|
|
|
message(STATUS "Project is built in RELEASE mode.")
|
|
|
|
message(STATUS "Disabling debug output.")
|
|
|
|
add_definitions(-DQT_NO_DEBUG_OUTPUT)
|
2018-06-05 04:03:38 +03:00
|
|
|
endif()
|
2015-11-06 21:03:18 +03:00
|
|
|
|
|
|
|
configure_file(config.h.cmakein ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
|
|
|
|
2016-04-17 01:55:45 +03:00
|
|
|
add_subdirectory(app)
|
|
|
|
add_subdirectory(base)
|
|
|
|
|
2020-05-02 20:59:26 +03:00
|
|
|
if (GUI)
|
2015-11-06 21:03:18 +03:00
|
|
|
add_subdirectory(gui)
|
2018-06-05 04:03:38 +03:00
|
|
|
endif ()
|
2015-11-06 21:03:18 +03:00
|
|
|
|
2020-05-02 20:59:26 +03:00
|
|
|
if (WEBUI)
|
2015-11-06 21:03:18 +03:00
|
|
|
add_subdirectory(webui)
|
2020-01-18 17:41:56 +03:00
|
|
|
endif()
|