qBittorrent/src/CMakeLists.txt

63 lines
1.9 KiB
Text
Raw Normal View History

include(MacroQbtCompilerSettings)
qbt_set_compiler_options()
include(QbtTargetSources)
2015-11-06 21:03:18 +03:00
find_package(Boost ${requiredBoostVersion} REQUIRED)
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
if (Boost_VERSION_STRING VERSION_LESS 1.60.0)
add_definitions(-DBOOST_NO_CXX11_RVALUE_REFERENCES)
endif()
find_package(Qt5 ${requiredQtVersion} REQUIRED COMPONENTS Core Network Xml LinguistTools)
2020-05-02 20:59:26 +03:00
if (GUI)
find_package(Qt5Widgets ${requiredQtVersion} REQUIRED)
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)
if (APPLE)
# Workaround CMake bug (autogen does not pass required parameters to moc)
# Relevant issue: https://gitlab.kitware.com/cmake/cmake/issues/18041
list(APPEND CMAKE_AUTOMOC_MOC_OPTIONS -DQ_OS_MACOS -DQ_OS_DARWIN)
endif()
2015-11-06 21:03:18 +03:00
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
# defines
add_definitions(-DQT_DEPRECATED_WARNINGS)
2015-11-06 21:03:18 +03:00
add_definitions(-DQT_NO_CAST_TO_ASCII)
add_definitions(-DQT_NO_CAST_FROM_BYTEARRAY)
add_definitions(-DQT_USE_QSTRINGBUILDER)
add_definitions(-DQT_STRICT_ITERATORS)
2015-11-06 21:03:18 +03:00
if (CMAKE_BUILD_TYPE MATCHES "Debug")
2015-11-06 21:03:18 +03:00
message(STATUS "Project is built in DEBUG mode.")
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)
endif()
2015-11-06 21:03:18 +03:00
configure_file(config.h.cmakein ${CMAKE_CURRENT_BINARY_DIR}/config.h)
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)
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)
endif()