Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[oatpp-curl] Fix curl dependency cannot be found #14385

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ports/oatpp-curl/CONTROL
Original file line number Diff line number Diff line change
@@ -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
33 changes: 0 additions & 33 deletions ports/oatpp-curl/curl-submodule-no-pkg-config-in-vcpkg.patch

This file was deleted.

51 changes: 51 additions & 0 deletions ports/oatpp-curl/fix-find-curl.patch
Original file line number Diff line number Diff line change
@@ -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
)

#######################################################################################################
2 changes: 1 addition & 1 deletion ports/oatpp-curl/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down