diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2016-09-18 20:50:08 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2016-09-18 20:54:03 -0700 |
| commit | ccca198c1b1730b0241911cb56dc8e3504958b2a (patch) | |
| tree | a2dd9b8b087a09afdcecc5cbb3377bed15127eb2 /ports/cpprestsdk | |
| download | vcpkg-ccca198c1b1730b0241911cb56dc8e3504958b2a.tar.gz vcpkg-ccca198c1b1730b0241911cb56dc8e3504958b2a.zip | |
Initial commit
Diffstat (limited to 'ports/cpprestsdk')
| -rw-r--r-- | ports/cpprestsdk/0001-Use-find_package-on-Windows.-Enable-install-target-f.patch | 107 | ||||
| -rw-r--r-- | ports/cpprestsdk/CONTROL | 4 | ||||
| -rw-r--r-- | ports/cpprestsdk/portfile.cmake | 50 |
3 files changed, 161 insertions, 0 deletions
diff --git a/ports/cpprestsdk/0001-Use-find_package-on-Windows.-Enable-install-target-f.patch b/ports/cpprestsdk/0001-Use-find_package-on-Windows.-Enable-install-target-f.patch new file mode 100644 index 000000000..40e6a5ce3 --- /dev/null +++ b/ports/cpprestsdk/0001-Use-find_package-on-Windows.-Enable-install-target-f.patch @@ -0,0 +1,107 @@ +From cc9d3ca4d1d16134a1976b89b58b11372a2798d5 Mon Sep 17 00:00:00 2001 +From: Robert Schumacher <roschuma@microsoft.com> +Date: Wed, 4 May 2016 21:37:23 -0700 +Subject: [PATCH] Use find_package on Windows. Enable 'install' target for all + systems. + +--- + Release/CMakeLists.txt | 48 ++++++++++++++-------------------------------- + Release/src/CMakeLists.txt | 13 +++++++------ + 2 files changed, 21 insertions(+), 40 deletions(-) + +diff --git a/Release/CMakeLists.txt b/Release/CMakeLists.txt +index cbe840b..3045948 100644 +--- a/Release/CMakeLists.txt ++++ b/Release/CMakeLists.txt +@@ -89,15 +89,6 @@ elseif(UNIX) # This includes OSX + + option(BUILD_SHARED_LIBS "Build shared Libraries." ON) + option(BUILD_SAMPLES "Build samples." ON) +- option(CASA_INSTALL_HEADERS "Install header files." ON) +- if(CASA_INSTALL_HEADERS) +- file(GLOB CASA_HEADERS_CPPREST include/cpprest/*.hpp include/cpprest/*.h include/cpprest/*.dat) +- install(FILES ${CASA_HEADERS_CPPREST} DESTINATION include/cpprest) +- file(GLOB CASA_HEADERS_PPLX include/pplx/*.hpp include/pplx/*.h) +- install(FILES ${CASA_HEADERS_PPLX} DESTINATION include/pplx) +- file(GLOB CASA_HEADERS_DETAILS include/cpprest/details/*.hpp include/cpprest/details/*.h include/cpprest/details/*.dat) +- install(FILES ${CASA_HEADERS_DETAILS} DESTINATION include/cpprest/details) +- endif() + elseif(WIN32) + option(BUILD_SHARED_LIBS "Build shared Libraries." ON) + option(BUILD_SAMPLES "Build samples." ON) +@@ -114,36 +105,25 @@ elseif(WIN32) + endif() + add_definitions(${Casablanca_DEFINITIONS} -D_WINSOCK_DEPRECATED_NO_WARNINGS -DWIN32) + +- if (NOT CPPREST_EXCLUDE_WEBSOCKETS) +- set(NUGET_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../packages") +- set(PACKAGE_PATHS) +- list(APPEND PACKAGE_PATHS "${NUGET_PATH}/boost.1.58.0.0/") +- list(APPEND PACKAGE_PATHS "${NUGET_PATH}/boost_system-vc140.1.58.0-vs140rc/") +- list(APPEND PACKAGE_PATHS "${NUGET_PATH}/boost_date_time-vc140.1.58.0-vs140rc/") +- list(APPEND PACKAGE_PATHS "${NUGET_PATH}/boost_regex-vc140.1.58.0-vs140rc/") +- list(APPEND PACKAGE_PATHS "${NUGET_PATH}/openssl.v140.windesktop.msvcstl.static.rt-dyn.x64.1.0.2.1/") +- list(APPEND PACKAGE_PATHS "${NUGET_PATH}/zlib.v140.windesktop.msvcstl.static.rt-dyn.1.2.8.8/") +- +- if (NOT WINDOWS_STORE AND NOT WINDOWS_PHONE) +- find_library(Boost_SYSTEM_LIBRARY libboost_system-vc140-mt-gd-1_58.lib PATHS ${PACKAGE_PATHS} PATH_SUFFIXES lib/native/address-model-64/lib) +- find_library(Boost_DATE_TIME_LIBRARY libboost_date_time-vc140-mt-gd-1_58.lib PATHS ${PACKAGE_PATHS} PATH_SUFFIXES lib/native/address-model-64/lib) +- find_library(Boost_REGEX_LIBRARY libboost_regex-vc140-mt-gd-1_58.lib PATHS ${PACKAGE_PATHS} PATH_SUFFIXES lib/native/address-model-64/lib) +- set(Boost_LIBRARIES ${Boost_REGEX_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_DATE_TIME_LIBRARY}) +- +- find_library(OpenSSL_libeay_LIBRARY libeay32.lib PATHS ${PACKAGE_PATHS} PATH_SUFFIXES lib/native/v140/windesktop/msvcstl/static/rt-dyn/x64/debug) +- find_library(OpenSSL_ssleay_LIBRARY ssleay32.lib PATHS ${PACKAGE_PATHS} PATH_SUFFIXES lib/native/v140/windesktop/msvcstl/static/rt-dyn/x64/debug) +- find_library(ZLIB_LIBRARY zlibstaticd.lib PATHS ${PACKAGE_PATHS} PATH_SUFFIXES lib/native/v140/windesktop/msvcstl/static/rt-dyn/x64/debug) +- set(OPENSSL_LIBRARIES ${OpenSSL_ssleay_LIBRARY} ${OpenSSL_libeay_LIBRARY} ${ZLIB_LIBRARY}) +- +- set(OPENSSL_INCLUDE_DIR "${NUGET_PATH}/openssl.v140.windesktop.msvcstl.static.rt-dyn.x64.1.0.2.1/build/native/include") +- endif() +- +- set(Boost_INCLUDE_DIR "${NUGET_PATH}/boost.1.58.0.0/lib/native/include") ++ if (NOT CPPREST_EXCLUDE_WEBSOCKETS AND NOT WINDOWS_STORE) ++ find_package(ZLIB REQUIRED) ++ find_package(OpenSSL REQUIRED) ++ find_package(Boost REQUIRED COMPONENTS regex system date_time) + endif() + else() + message(FATAL_ERROR "-- Unsupported Build Platform.") + endif() + ++option(CASA_INSTALL_HEADERS "Install header files." ON) ++if(CASA_INSTALL_HEADERS) ++ file(GLOB CASA_HEADERS_CPPREST include/cpprest/*.hpp include/cpprest/*.h include/cpprest/*.dat) ++ install(FILES ${CASA_HEADERS_CPPREST} DESTINATION include/cpprest) ++ file(GLOB CASA_HEADERS_PPLX include/pplx/*.hpp include/pplx/*.h) ++ install(FILES ${CASA_HEADERS_PPLX} DESTINATION include/pplx) ++ file(GLOB CASA_HEADERS_DETAILS include/cpprest/details/*.hpp include/cpprest/details/*.h include/cpprest/details/*.dat) ++ install(FILES ${CASA_HEADERS_DETAILS} DESTINATION include/cpprest/details) ++endif() ++ + # Compiler (not platform) specific settings + if(ANDROID) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-strict-aliasing") +diff --git a/Release/src/CMakeLists.txt b/Release/src/CMakeLists.txt +index cf086ed..3e5fffa 100644 +--- a/Release/src/CMakeLists.txt ++++ b/Release/src/CMakeLists.txt +@@ -144,10 +144,11 @@ elseif(ANDROID) + else() + set_target_properties(cpprest PROPERTIES + SOVERSION ${CPPREST_VERSION_MAJOR}.${CPPREST_VERSION_MINOR}) +- +- install( +- TARGETS cpprest +- LIBRARY DESTINATION lib +- ARCHIVE DESTINATION lib +- ) + endif() ++ ++install( ++ TARGETS cpprest ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib ++ ) +-- +2.8.1.windows.1 + diff --git a/ports/cpprestsdk/CONTROL b/ports/cpprestsdk/CONTROL new file mode 100644 index 000000000..eca83755b --- /dev/null +++ b/ports/cpprestsdk/CONTROL @@ -0,0 +1,4 @@ +Source: cpprestsdk +Version: 2.8 +Description: C++11 JSON, REST, and OAuth library + The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.
\ No newline at end of file diff --git a/ports/cpprestsdk/portfile.cmake b/ports/cpprestsdk/portfile.cmake new file mode 100644 index 000000000..ba9ea77e3 --- /dev/null +++ b/ports/cpprestsdk/portfile.cmake @@ -0,0 +1,50 @@ +include(vcpkg_common_functions) +find_program(GIT git) + +set(GIT_URL "https://github.com/Microsoft/cpprestsdk") +set(GIT_REF "3542f07") + +if(NOT EXISTS "${DOWNLOADS}/cpprestsdk.git") + message(STATUS "Cloning") + vcpkg_execute_required_process( + COMMAND ${GIT} clone --bare ${GIT_URL} ${DOWNLOADS}/cpprestsdk.git + WORKING_DIRECTORY ${DOWNLOADS} + LOGNAME clone + ) +endif() +message(STATUS "Cloning done") + +if(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") + message(STATUS "Adding worktree and patching") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}) + vcpkg_execute_required_process( + COMMAND ${GIT} worktree add -f --detach ${CURRENT_BUILDTREES_DIR}/src ${GIT_REF} + WORKING_DIRECTORY ${DOWNLOADS}/cpprestsdk.git + LOGNAME worktree + ) + message(STATUS "Patching") + vcpkg_execute_required_process( + COMMAND ${GIT} apply ${CMAKE_CURRENT_LIST_DIR}/0001-Use-find_package-on-Windows.-Enable-install-target-f.patch --ignore-whitespace --whitespace=fix + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src + LOGNAME patch + ) +endif() +message(STATUS "Adding worktree and patching done") + +vcpkg_configure_cmake( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/Release + OPTIONS + -DBUILD_TESTS=OFF + -DBUILD_SAMPLES=OFF + -DCPPREST_EXCLUDE_WEBSOCKETS=ON + OPTIONS_DEBUG + -DCASA_INSTALL_HEADERS=OFF +) + +vcpkg_build_cmake() +vcpkg_install_cmake() + +file(COPY ${CURRENT_BUILDTREES_DIR}/src/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/cpprestsdk) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/cpprestsdk/license.txt ${CURRENT_PACKAGES_DIR}/share/cpprestsdk/copyright) +vcpkg_copy_pdbs() + |
