vcpkg/ports/cpprestsdk/portfile.cmake
Billy O'Neal f4359f404a
[cpprestsdk] Update to v2.10.15. (#10191)
* [cpprestsdk] Update to v2.10.15.

* fix baseline

Fixes cpprestdsk on UWP.

Co-authored-by: nicole mazzuca <mazzucan@outlook.com>
2020-02-26 13:57:43 -08:00

60 lines
1.7 KiB
CMake

include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Microsoft/cpprestsdk
REF v2.10.15
SHA512 ef8884c9f7fde2b6a25357ef0e7ee87b473a2e3140af2c5af0e3be7776ac2e8c0da431a356892020a3c37c84e30396350e2083cd4e1192a41fd3e099e74179f7
HEAD_REF master
)
set(OPTIONS)
if(NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
SET(WEBSOCKETPP_PATH "${CURRENT_INSTALLED_DIR}/share/websocketpp")
list(APPEND OPTIONS
-DWEBSOCKETPP_CONFIG=${WEBSOCKETPP_PATH}
-DWEBSOCKETPP_CONFIG_VERSION=${WEBSOCKETPP_PATH})
endif()
set(CPPREST_EXCLUDE_BROTLI ON)
if ("brotli" IN_LIST FEATURES)
set(CPPREST_EXCLUDE_BROTLI OFF)
endif()
set(CPPREST_EXCLUDE_COMPRESSION ON)
if ("compression" IN_LIST FEATURES)
set(CPPREST_EXCLUDE_COMPRESSION OFF)
endif()
set(CPPREST_EXCLUDE_WEBSOCKETS ON)
if("websockets" IN_LIST FEATURES)
set(CPPREST_EXCLUDE_WEBSOCKETS OFF)
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}/Release
PREFER_NINJA
OPTIONS
${OPTIONS}
-DBUILD_TESTS=OFF
-DBUILD_SAMPLES=OFF
-DCPPREST_EXCLUDE_BROTLI=${CPPREST_EXCLUDE_BROTLI}
-DCPPREST_EXCLUDE_COMPRESSION=${CPPREST_EXCLUDE_COMPRESSION}
-DCPPREST_EXCLUDE_WEBSOCKETS=${CPPREST_EXCLUDE_WEBSOCKETS}
-DCPPREST_EXPORT_DIR=share/cpprestsdk
-DWERROR=OFF
OPTIONS_DEBUG
-DCPPREST_INSTALL_HEADERS=OFF
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/share/cpprestsdk)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/share ${CURRENT_PACKAGES_DIR}/lib/share)
file(INSTALL
${SOURCE_PATH}/license.txt
DESTINATION ${CURRENT_PACKAGES_DIR}/share/cpprestsdk RENAME copyright)
vcpkg_copy_pdbs()