2021-08-11 06:00:57 +03:00
|
|
|
# Try to find libtorrent-rasterbar, once done this will define:
|
|
|
|
#
|
|
|
|
# LIBTORRENT_FOUND - system has libtorrent-rasterbar
|
|
|
|
# LIBTORRENT_INCLUDES - the libtorrent-rasterbar include directory
|
|
|
|
# LIBTORRENT_LIBRARIES - the libraries needed to use libtorrent-rasterbar
|
|
|
|
#
|
|
|
|
# Copyright (c) 2021 Ivailo Monev <xakepa10@gmail.com>
|
|
|
|
#
|
|
|
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
|
|
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|
|
|
|
2022-10-02 10:46:46 +03:00
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_check_modules(PC_LIBTORRENT QUIET libtorrent-rasterbar)
|
2021-08-11 06:00:57 +03:00
|
|
|
|
2022-10-02 10:46:46 +03:00
|
|
|
set(LIBTORRENT_INCLUDES ${PC_LIBTORRENT_INCLUDE_DIRS})
|
|
|
|
set(LIBTORRENT_LIBRARIES ${PC_LIBTORRENT_LIBRARIES})
|
2021-08-11 06:00:57 +03:00
|
|
|
set(LIBTORRENT_VERSION ${PC_LIBTORRENT_VERSION})
|
|
|
|
|
|
|
|
if(NOT LIBTORRENT_INCLUDES OR NOT LIBTORRENT_LIBRARIES)
|
|
|
|
find_path(LIBTORRENT_INCLUDES
|
|
|
|
NAMES torrent.hpp
|
|
|
|
PATH_SUFFIXES libtorrent
|
|
|
|
HINTS $ENV{LIBTORRENTDIR}/include
|
|
|
|
)
|
|
|
|
|
|
|
|
find_library(LIBTORRENT_LIBRARIES
|
|
|
|
NAMES torrent-rasterbar
|
|
|
|
HINTS $ENV{LIBTORRENTDIR}/lib
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(LibTorrent
|
|
|
|
VERSION_VAR LIBTORRENT_VERSION
|
|
|
|
REQUIRED_VARS LIBTORRENT_LIBRARIES LIBTORRENT_INCLUDES
|
|
|
|
)
|
|
|
|
|
|
|
|
mark_as_advanced(LIBTORRENT_INCLUDES LIBTORRENT_LIBRARIES)
|