1 macro(find_libtorrent version)
2 if (UNIX AND (NOT APPLE) AND (NOT CYGWIN))
3 find_package(LibtorrentRasterbar QUIET ${version} COMPONENTS torrent-rasterbar)
4 if (NOT LibtorrentRasterbar_FOUND)
6 pkg_check_modules(LibtorrentRasterbar IMPORTED_TARGET GLOBAL "libtorrent-rasterbar>=${version}")
7 if (NOT LibtorrentRasterbar_FOUND)
10 "Package LibtorrentRasterbar >= ${version} not found"
11 " with CMake or pkg-config.\n- Set LibtorrentRasterbar_DIR to a directory containing"
12 " a LibtorrentRasterbarConfig.cmake file or add the installation prefix of LibtorrentRasterbar"
13 " to CMAKE_PREFIX_PATH.\n- Alternatively, make sure there is a valid libtorrent-rasterbar.pc"
14 " file in your system's pkg-config search paths (use the system environment variable PKG_CONFIG_PATH"
15 " to specify additional search paths if needed)."
18 add_library(LibtorrentRasterbar::torrent-rasterbar ALIAS PkgConfig::LibtorrentRasterbar)
19 # force a fake package to show up in the feature summary
20 set_property(GLOBAL APPEND PROPERTY
22 "LibtorrentRasterbar via pkg-config (version >= ${version})"
24 set_package_properties("LibtorrentRasterbar via pkg-config (version >= ${version})"
29 set_package_properties(LibtorrentRasterbar PROPERTIES TYPE REQUIRED)
32 find_package(LibtorrentRasterbar ${version} REQUIRED COMPONENTS torrent-rasterbar)
36 find_libtorrent(${minLibtorrent1Version})
37 if (LibtorrentRasterbar_FOUND AND (LibtorrentRasterbar_VERSION VERSION_GREATER_EQUAL 2.0))
38 find_libtorrent(${minLibtorrentVersion})
41 # force variable type so that it always shows up in ccmake/cmake-gui frontends
42 set_property(CACHE LibtorrentRasterbar_DIR PROPERTY TYPE PATH)
43 find_package(Boost ${minBoostVersion} REQUIRED)
44 find_package(OpenSSL ${minOpenSSLVersion} REQUIRED)
45 find_package(ZLIB ${minZlibVersion} REQUIRED)
47 find_package(Qt6 ${minQt6Version} REQUIRED COMPONENTS Core Network Sql Xml LinguistTools)
49 find_package(Qt6 ${minQt6Version} REQUIRED COMPONENTS DBus)
50 set_package_properties(Qt6DBus PROPERTIES
51 DESCRIPTION "Qt6 module for inter-process communication over the D-Bus protocol"
52 PURPOSE "Required by the DBUS feature"
56 find_package(Qt5 ${minQt5Version} REQUIRED COMPONENTS Core Network Sql Xml LinguistTools)
58 find_package(Qt5 ${minQt5Version} REQUIRED COMPONENTS DBus)
59 set_package_properties(Qt5DBus PROPERTIES
60 DESCRIPTION "Qt5 module for inter-process communication over the D-Bus protocol"
61 PURPOSE "Required by the DBUS feature"
66 # automatically call Qt moc, rcc and uic as needed for all targets by default
67 set(CMAKE_AUTORCC_OPTIONS --compress 9 --threshold 5)
72 # create interface-only target libraries with common compile options/definitions to link to
73 include(MacroQbtCommonConfig)
76 # include directories - ideally, would be done per target instead of global directory scope
77 include_directories(${CMAKE_CURRENT_SOURCE_DIR})
79 add_subdirectory(base)
83 find_package(Qt6 ${minQt6Version} REQUIRED COMPONENTS Widgets Svg)
85 find_package(Qt5 ${minQt5Version} REQUIRED COMPONENTS Widgets Svg)
86 if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
87 find_package(Qt5 ${minQt5Version} REQUIRED COMPONENTS WinExtras)
95 add_subdirectory(webui)