aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-06-20 15:38:52 -0700
committerGitHub <noreply@github.com>2017-06-20 15:38:52 -0700
commite0f04703374bbe9c99988d1220920ad526b8e565 (patch)
tree1afa2bfa3615e2e82a7a57195f5a320745b279e2
parent9f0f110f36ed9b91b1fa2b2ab1165555b540af4d (diff)
parentd026905ae90290fd808ee0896e11e71f2ff8ac5b (diff)
downloadvcpkg-e0f04703374bbe9c99988d1220920ad526b8e565.tar.gz
vcpkg-e0f04703374bbe9c99988d1220920ad526b8e565.zip
Merge pull request #1316 from moffel/cpr
[cpr] add c++ requests 1.3.0 port
-rw-r--r--ports/cpr/CONTROL4
-rw-r--r--ports/cpr/enable-install.patch17
-rw-r--r--ports/cpr/portfile.cmake32
3 files changed, 53 insertions, 0 deletions
diff --git a/ports/cpr/CONTROL b/ports/cpr/CONTROL
new file mode 100644
index 000000000..417850b75
--- /dev/null
+++ b/ports/cpr/CONTROL
@@ -0,0 +1,4 @@
+Source: cpr
+Version: 1.3.0
+Description: C++ Requests is a simple wrapper around libcurl inspired by the excellent Python Requests project.
+Build-Depends: curl
diff --git a/ports/cpr/enable-install.patch b/ports/cpr/enable-install.patch
new file mode 100644
index 000000000..da8d3ee73
--- /dev/null
+++ b/ports/cpr/enable-install.patch
@@ -0,0 +1,17 @@
+diff --git a/cpr/CMakeLists.txt b/cpr/CMakeLists.txt
+index a6db5bd..b4982d1 100644
+--- a/cpr/CMakeLists.txt
++++ b/cpr/CMakeLists.txt
+@@ -45,3 +45,12 @@ add_library(${CPR_LIBRARIES}
+ message(STATUS "Using CURL_LIBRARIES: ${CURL_LIBRARIES}.")
+ target_link_libraries(${CPR_LIBRARIES}
+ ${CURL_LIBRARIES})
++
++install(TARGETS ${CPR_LIBRARIES}
++ RUNTIME DESTINATION bin
++ LIBRARY DESTINATION lib
++ ARCHIVE DESTINATION lib
++)
++if(NOT DISABLE_INSTALL_HEADERS)
++ install(DIRECTORY ${CPR_INCLUDE_DIRS} DESTINATION include)
++endif()
diff --git a/ports/cpr/portfile.cmake b/ports/cpr/portfile.cmake
new file mode 100644
index 000000000..281e0da43
--- /dev/null
+++ b/ports/cpr/portfile.cmake
@@ -0,0 +1,32 @@
+include(vcpkg_common_functions)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO whoshuu/cpr
+ REF 1.3.0
+ SHA512 fd08f8a592a5e1fb8dc93158a4850b81575983c08527fb415f65bd9284f93c804c8680d16c548744583cd26b9353a7d4838269cfc59ccb6003da8941f620c273
+)
+
+vcpkg_apply_patches(
+ SOURCE_PATH ${SOURCE_PATH}
+ PATCHES ${CMAKE_CURRENT_LIST_DIR}/enable-install.patch
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS
+ -DBUILD_CPR_TESTS=OFF
+ -DUSE_SYSTEM_CURL=ON
+ -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON
+ OPTIONS_DEBUG
+ -DDISABLE_INSTALL_HEADERS=ON
+)
+
+vcpkg_install_cmake()
+
+vcpkg_copy_pdbs()
+
+# Handle copyright
+file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/cpr)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/cpr/LICENSE ${CURRENT_PACKAGES_DIR}/share/cpr/copyright)