2017-07-07 22:32:34 +08:00
|
|
|
include(vcpkg_common_functions)
|
|
|
|
|
2017-12-06 05:01:50 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO arvidn/libtorrent
|
2019-05-17 09:33:32 +08:00
|
|
|
REF 76c2794923c4c101ff715be11d794f7fefc6c524
|
|
|
|
SHA512 3e154857bb56318ebe725326e1832aa387dc85840be80ebe76c0265e8fded43bc3006d528784c8805e30c3fba41b4108ccf81170870d1686dc499048367563ea
|
2017-12-06 05:01:50 +08:00
|
|
|
HEAD_REF master
|
2019-05-17 09:33:32 +08:00
|
|
|
PATCHES
|
|
|
|
add-datetime-to-boost-libs.patch
|
|
|
|
windows-boost-1.70.patch
|
2017-07-07 22:32:34 +08:00
|
|
|
)
|
|
|
|
|
2017-12-06 05:01:50 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" LIBTORRENT_SHARED)
|
|
|
|
|
2017-07-07 22:32:34 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PREFER_NINJA # Disable this option if project cannot be built with Ninja
|
|
|
|
OPTIONS
|
2017-07-10 04:34:33 +08:00
|
|
|
-Dshared=${LIBTORRENT_SHARED}
|
2017-07-07 22:32:34 +08:00
|
|
|
-Ddeprecated-functions=off
|
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
2017-12-06 05:01:50 +08:00
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
2017-07-10 04:34:33 +08:00
|
|
|
# Defines for shared lib
|
2019-01-31 08:04:17 +08:00
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/include/libtorrent/aux_/export.hpp EXPORT_H)
|
2017-07-10 04:34:33 +08:00
|
|
|
string(REPLACE "defined TORRENT_BUILDING_SHARED" "1" EXPORT_H "${EXPORT_H}")
|
2019-01-31 08:04:17 +08:00
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/include/libtorrent/aux_/export.hpp "${EXPORT_H}")
|
2017-07-07 22:32:34 +08:00
|
|
|
endif()
|
|
|
|
|
2019-01-31 08:04:17 +08:00
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/LibtorrentRasterbar TARGET_PATH share/libtorrentrasterbar)
|
|
|
|
|
2017-07-07 22:32:34 +08:00
|
|
|
# Handle copyright
|
|
|
|
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libtorrent)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libtorrent/LICENSE ${CURRENT_PACKAGES_DIR}/share/libtorrent/copyright)
|
|
|
|
|
|
|
|
# Do not duplicate include files
|
2019-01-31 08:04:17 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/share/cmake)
|