aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/oatpp-curl/CONTROL2
-rw-r--r--ports/oatpp-curl/curl-submodule-no-pkg-config-in-vcpkg.patch33
-rw-r--r--ports/oatpp-curl/fix-find-curl.patch51
-rw-r--r--ports/oatpp-curl/portfile.cmake2
4 files changed, 53 insertions, 35 deletions
diff --git a/ports/oatpp-curl/CONTROL b/ports/oatpp-curl/CONTROL
index a05945d4b..5fbb30fc7 100644
--- a/ports/oatpp-curl/CONTROL
+++ b/ports/oatpp-curl/CONTROL
@@ -1,6 +1,6 @@
Source: oatpp-curl
Version: 1.2.0
-Port-Version: 1
+Port-Version: 2
Description: Oat++ Modern web framework curl module to use libcurl as a RequestExecutor on the oatpp's ApiClient
Build-Depends: curl,oatpp
Homepage: https://github.com/oatpp/oatpp-curl
diff --git a/ports/oatpp-curl/curl-submodule-no-pkg-config-in-vcpkg.patch b/ports/oatpp-curl/curl-submodule-no-pkg-config-in-vcpkg.patch
deleted file mode 100644
index 75fe7af36..000000000
--- a/ports/oatpp-curl/curl-submodule-no-pkg-config-in-vcpkg.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 477064a..5da99e9 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -95,8 +95,26 @@ message("## ${OATPP_THIS_MODULE_NAME} module. Resolving dependencies...\n")
- ##############################
- ## Find libcurl dependency
-
--include(FindPkgConfig)
--pkg_check_modules(PKG_CURL REQUIRED libcurl)
-+if (VCPKG_TOOLCHAIN)
-+ find_package(CURL REQUIRED)
-+ if (CMAKE_BUILD_TYPE MATCHES "^[Dd][Ee][Bb][Uu][Gg]$")
-+ get_filename_component(PKG_CURL_LIBRARIES ${CURL_LIBRARY_DEBUG} NAME)
-+ get_filename_component(PKG_CURL_LIBRARY_DIR ${CURL_LIBRARY_DEBUG} DIRECTORY)
-+ else()
-+ get_filename_component(PKG_CURL_LIBRARIES ${CURL_LIBRARY_RELEASE} NAME)
-+ get_filename_component(PKG_CURL_LIBRARY_DIR ${CURL_LIBRARY_RELEASE} DIRECTORY)
-+ endif()
-+ if (PKG_CURL_LIBRARIES MATCHES [[^.*\.a$]])
-+ string(LENGTH ${PKG_CURL_LIBRARIES} _LEN)
-+ math(EXPR _LEN "${_LEN} - 5")
-+ string(SUBSTRING ${PKG_CURL_LIBRARIES} 3 ${_LEN} PKG_CURL_LIBRARIES)
-+ endif()
-+ set(PKG_CURL_VERSION ${CURL_VERSION})
-+ set(PKG_CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIRS})
-+else()
-+ include(FindPkgConfig)
-+ pkg_check_modules(PKG_CURL REQUIRED libcurl)
-+endif()
-
- message("[libcurl] libcurl found:")
- message("[libcurl] LIBRARIES=${PKG_CURL_LIBRARIES}")
diff --git a/ports/oatpp-curl/fix-find-curl.patch b/ports/oatpp-curl/fix-find-curl.patch
new file mode 100644
index 000000000..bd1762955
--- /dev/null
+++ b/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/ports/oatpp-curl/portfile.cmake b/ports/oatpp-curl/portfile.cmake
index e8fd3a50d..25146a81d 100644
--- a/ports/oatpp-curl/portfile.cmake
+++ b/ports/oatpp-curl/portfile.cmake
@@ -8,7 +8,7 @@ vcpkg_from_github(
REF b7c0507e286fbc55ccbbb4a2604f6c46d3a86525 # 1.2.0
SHA512 274aaf34733ab70b148182332db493157ed8c87e093d09bf7dcbd9c89034dab9a97f05ba0887459a8a0ed80b2c2248c253b1ff8c933e196a6ecee11546a4488b
HEAD_REF master
- PATCHES "curl-submodule-no-pkg-config-in-vcpkg.patch"
+ PATCHES "fix-find-curl.patch"
)
vcpkg_configure_cmake(