aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/oatpp-curl
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/oatpp-curl')
-rw-r--r--vcpkg/ports/oatpp-curl/fix-find-curl.patch51
-rw-r--r--vcpkg/ports/oatpp-curl/portfile.cmake25
-rw-r--r--vcpkg/ports/oatpp-curl/vcpkg.json20
3 files changed, 96 insertions, 0 deletions
diff --git a/vcpkg/ports/oatpp-curl/fix-find-curl.patch b/vcpkg/ports/oatpp-curl/fix-find-curl.patch
new file mode 100644
index 0000000..bd17629
--- /dev/null
+++ b/vcpkg/ports/oatpp-curl/fix-find-curl.patch
@@ -0,0 +1,51 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 85edfe7..a8aa02b 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -94,7 +94,7 @@ message("## ${OATPP_THIS_MODULE_NAME} module. Resolving dependencies...\n")
+
+ ##############################
+ ## Find libcurl dependency
+-
++if(0)
+ include(FindPkgConfig)
+ pkg_check_modules(PKG_CURL REQUIRED libcurl)
+
+@@ -103,9 +103,10 @@ message("[libcurl] LIBRARIES=${PKG_CURL_LIBRARIES}")
+ message("[libcurl] LIBRARY_DIRS=${PKG_CURL_LIBRARY_DIRS}")
+ message("[libcurl] INCLUDE_DIRS=${PKG_CURL_INCLUDE_DIRS}")
+ message("[libcurl] VERSION=${PKG_CURL_VERSION}\n")
+-
++endif()
++find_package(CURL CONFIG REQUIRED)
+ link_directories(
+- ${PKG_CURL_LIBRARY_DIRS}
++ CURL::libcurl
+ )
+
+ message("\n############################################################################\n")
+diff --git a/cmake/module-config.cmake.in b/cmake/module-config.cmake.in
+index 5cc12b0..4ff34bc 100644
+--- a/cmake/module-config.cmake.in
++++ b/cmake/module-config.cmake.in
+@@ -1,5 +1,6 @@
+ @PACKAGE_INIT@
+-
++include(CMakeFindDependencyMacro)
++find_dependency(CURL)
+ if(NOT TARGET oatpp::@OATPP_MODULE_NAME@)
+ include("${CMAKE_CURRENT_LIST_DIR}/@OATPP_MODULE_NAME@Targets.cmake")
+ endif()
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 8c2087f..1da41c6 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -43,7 +43,7 @@ target_include_directories(${OATPP_THIS_MODULE_NAME}
+ #)
+
+ target_link_libraries(${OATPP_THIS_MODULE_NAME}
+- PRIVATE ${PKG_CURL_LIBRARIES}
++ PRIVATE CURL::libcurl
+ )
+
+ #######################################################################################################
diff --git a/vcpkg/ports/oatpp-curl/portfile.cmake b/vcpkg/ports/oatpp-curl/portfile.cmake
new file mode 100644
index 0000000..7dff231
--- /dev/null
+++ b/vcpkg/ports/oatpp-curl/portfile.cmake
@@ -0,0 +1,25 @@
+set(OATPP_VERSION "1.3.0")
+
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO oatpp/oatpp-curl
+ REF ${OATPP_VERSION}
+ SHA512 d9437a6b3a214bf0f17561e905709d741cd7d5fcad30ec0cdddeaacb3a72142bf8b24034d13201cd416898ffd0ab07ca50ec66d4025406acee1518ae65dac45e
+ HEAD_REF master
+ PATCHES "fix-find-curl.patch"
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ "-DOATPP_BUILD_TESTS:BOOL=OFF"
+)
+
+vcpkg_cmake_install()
+vcpkg_cmake_config_fixup(PACKAGE_NAME oatpp-curl CONFIG_PATH lib/cmake/oatpp-curl-${OATPP_VERSION})
+vcpkg_copy_pdbs()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
diff --git a/vcpkg/ports/oatpp-curl/vcpkg.json b/vcpkg/ports/oatpp-curl/vcpkg.json
new file mode 100644
index 0000000..8690483
--- /dev/null
+++ b/vcpkg/ports/oatpp-curl/vcpkg.json
@@ -0,0 +1,20 @@
+{
+ "name": "oatpp-curl",
+ "version": "1.3.0",
+ "port-version": 1,
+ "description": "Oat++ Modern web framework curl module to use libcurl as a RequestExecutor on the oatpp's ApiClient.",
+ "homepage": "https://github.com/oatpp/oatpp-curl",
+ "license": "Apache-2.0",
+ "dependencies": [
+ "curl",
+ "oatpp",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}