1 # use CONFIG mode first in find_package
2 set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
4 macro(find_libtorrent version)
5 if (UNIX AND (NOT APPLE) AND (NOT CYGWIN))
6 find_package(LibtorrentRasterbar QUIET ${version} COMPONENTS torrent-rasterbar)
7 if (NOT LibtorrentRasterbar_FOUND)
9 pkg_check_modules(LibtorrentRasterbar IMPORTED_TARGET GLOBAL "libtorrent-rasterbar>=${version}")
10 if (NOT LibtorrentRasterbar_FOUND)
13 "Package LibtorrentRasterbar >= ${version} not found"
14 " with CMake or pkg-config.\n- Set LibtorrentRasterbar_DIR to a directory containing"
15 " a LibtorrentRasterbarConfig.cmake file or add the installation prefix of LibtorrentRasterbar"
16 " to CMAKE_PREFIX_PATH.\n- Alternatively, make sure there is a valid libtorrent-rasterbar.pc"
17 " file in your system's pkg-config search paths (use the system environment variable PKG_CONFIG_PATH"
18 " to specify additional search paths if needed)."
21 add_library(LibtorrentRasterbar::torrent-rasterbar ALIAS PkgConfig::LibtorrentRasterbar)
22 # force a fake package to show up in the feature summary
23 set_property(GLOBAL APPEND PROPERTY
25 "LibtorrentRasterbar via pkg-config (version >= ${version})"
27 set_package_properties("LibtorrentRasterbar via pkg-config (version >= ${version})"
32 set_package_properties(LibtorrentRasterbar PROPERTIES TYPE REQUIRED)
35 find_package(LibtorrentRasterbar ${version} REQUIRED COMPONENTS torrent-rasterbar)
39 find_libtorrent(${minLibtorrent1Version})
40 if (LibtorrentRasterbar_FOUND AND (LibtorrentRasterbar_VERSION VERSION_GREATER_EQUAL 2.0))
41 find_libtorrent(${minLibtorrentVersion})
44 # force variable type so that it always shows up in ccmake/cmake-gui frontends
45 set_property(CACHE LibtorrentRasterbar_DIR PROPERTY TYPE PATH)
46 find_package(Boost ${minBoostVersion} REQUIRED)
47 find_package(OpenSSL ${minOpenSSLVersion} REQUIRED)
48 find_package(ZLIB ${minZlibVersion} REQUIRED)
49 find_package(Qt6 ${minQt6Version} REQUIRED COMPONENTS Core Network Sql Xml LinguistTools)
51 find_package(Qt6 ${minQt6Version} REQUIRED COMPONENTS DBus)
52 set_package_properties(Qt6DBus PROPERTIES
53 DESCRIPTION "Qt6 module for inter-process communication over the D-Bus protocol"
54 PURPOSE "Required by the DBUS feature"