vcpkg/ports/libtorrent/portfile.cmake
Robert Schumacher 9d473a6954
[boost] Update to 1.70.0 (#6141)
* [boost] Update to 1.70.0

* [boost-build] Update to 1.70.0

* [folly][freeopcua][libtorrent][websocketpp] Upgrades/patches to handle boost 1.70

* [boost-variant] Revert to 1.69 due to regression
[fizz][folly] Update and fix for boost 1.70
[libsodium] Use CMake buildsystem replacement to enable non-Windows

* [wangle] Update. [folly] Avoid linking debug libs in release.

* [pcl] Fix compatibility with boost 1.70

* [fizz] Handle merge regression

* [arrow] Modernize and fix cmake targets

* [boost-type-traits] Update patches for arm64-windows

* [boost-locale] Add boost-system and boost-thread as arm64 dependencies

* [ompl] Add missing boost-timer dependency
2019-05-16 18:33:32 -07:00

41 lines
1.5 KiB
CMake

include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO arvidn/libtorrent
REF 76c2794923c4c101ff715be11d794f7fefc6c524
SHA512 3e154857bb56318ebe725326e1832aa387dc85840be80ebe76c0265e8fded43bc3006d528784c8805e30c3fba41b4108ccf81170870d1686dc499048367563ea
HEAD_REF master
PATCHES
add-datetime-to-boost-libs.patch
windows-boost-1.70.patch
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" LIBTORRENT_SHARED)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA # Disable this option if project cannot be built with Ninja
OPTIONS
-Dshared=${LIBTORRENT_SHARED}
-Ddeprecated-functions=off
)
vcpkg_install_cmake()
if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
# Defines for shared lib
file(READ ${CURRENT_PACKAGES_DIR}/include/libtorrent/aux_/export.hpp EXPORT_H)
string(REPLACE "defined TORRENT_BUILDING_SHARED" "1" EXPORT_H "${EXPORT_H}")
file(WRITE ${CURRENT_PACKAGES_DIR}/include/libtorrent/aux_/export.hpp "${EXPORT_H}")
endif()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/LibtorrentRasterbar TARGET_PATH share/libtorrentrasterbar)
# 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
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/share/cmake)