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

[curl] Update to 7.66.0 #7331

Merged
merged 14 commits into from
Sep 27, 2019
2 changes: 1 addition & 1 deletion ports/curl/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: curl
Version: 7.65.2-1
Version: 7.66.0
Build-Depends: zlib
Homepage: https://github.com/curl/curl
Description: A library for transferring data with URLs
Expand Down
20 changes: 15 additions & 5 deletions ports/curl/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO curl/curl
REF curl-7_65_2
SHA512 8e06377a6d8837a4c2cd96f978f0ac848b9472500fd25983bb1f9e5f52d9d6f7ff0c71d443587a979cf80fd19412bb64b9362b774cf91e02479fdfad7e085b16
REF curl-7_66_0
SHA512 0b02b6117ab69e848219fa59b25e4254934d841fbc3e2a70ccfdcb417ab7fc46a10dd703a25fbe8a2a98a59cbc73ad6b9298f5668a7345f7910010b958de4d21
HEAD_REF master
PATCHES
0001_cmake.patch
Expand Down Expand Up @@ -175,6 +175,16 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
else()
file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/curl-config ${CURRENT_PACKAGES_DIR}/debug/bin/curl-config)

file(GLOB FILES LIST_DIRECTORIES TRUE ${CURRENT_PACKAGES_DIR}/bin/*)
if (FILES STREQUAL "")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
endif()

file(GLOB FILES LIST_DIRECTORIES TRUE ${CURRENT_PACKAGES_DIR}/debug/bin/*)
if (FILES STREQUAL "")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()
endif()

file(READ ${CURRENT_PACKAGES_DIR}/include/curl/curl.h CURL_H)
Expand All @@ -185,8 +195,8 @@ else()
endif()
file(WRITE ${CURRENT_PACKAGES_DIR}/include/curl/curl.h "${CURL_H}")

vcpkg_copy_pdbs()
file(INSTALL ${CURRENT_PORT_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/curl)

file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
vcpkg_copy_pdbs()

vcpkg_test_cmake(PACKAGE_NAME CURL MODULE)
vcpkg_test_cmake(PACKAGE_NAME CURL)
5 changes: 0 additions & 5 deletions ports/curl/usage

This file was deleted.

52 changes: 52 additions & 0 deletions ports/curl/vcpkg-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
set (FOUND_CONFIG FALSE)

foreach (ARG ${ARGS})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it really necessary? looks unnecessarily complicated.
I'd take a look at what I did for LibLZMA, also because there is the "MODULE" keyword forgotten (which is incompatible with the CONFIG keyword but not managed here...)

https://github.com/microsoft/vcpkg/blob/master/ports/liblzma/vcpkg-cmake-wrapper.cmake

Copy link
Contributor

@cbezault cbezault Sep 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm, is list(REMOVE_ITEM) case-insensitive? It does look cleaner.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you really pass MODULE, CONFIG and NO_MODULE lowercase? TWIL

Copy link
Contributor

@cbezault cbezault Sep 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, apparently it's inconsistently implemented but they are supposed to be case-sensitive. TIL. I'll move to your approach.

string (TOUPPER "${ARG}" ARG)

if (${ARG} STREQUAL "CONFIG" OR ${ARG} STREQUAL "NO_MODULE")
set (FOUND_CONFIG TRUE)
endif()
endforeach()

if (FOUND_CONFIG)
_find_package(${ARGS})
else()
_find_package(${ARGS} CONFIG)
endif()

if(TARGET CURL::libcurl)
set(CURL_FOUND TRUE)

get_target_property(_curl_include_dirs CURL::libcurl INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(_curl_link_libraries CURL::libcurl INTERFACE_LINK_LIBRARIES)

if (CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
get_target_property(_curl_location_debug CURL::libcurl IMPORTED_IMPLIB_DEBUG)
get_target_property(_curl_location_release CURL::libcurl IMPORTED_IMPLIB_RELEASE)
endif()

if(NOT _curl_location_debug AND NOT _curl_location_release)
get_target_property(_curl_location_debug CURL::libcurl IMPORTED_LOCATION_DEBUG)
get_target_property(_curl_location_release CURL::libcurl IMPORTED_LOCATION_RELEASE)
endif()

if(NOT _curl_link_libraries)
set(_curl_link_libraries)
endif()

set(CURL_INCLUDE_DIRS "${_curl_include_dirs}")
set(CURL_LIBRARY_DEBUG "${_curl_location_debug}")
set(CURL_LIBRARY_RELEASE "${_curl_location_release}")

#For builds which rely on CURL_LIBRAR(Y/IES)
include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake)
select_library_configurations(CURL)

set(CURL_LIBRARIES ${CURL_LIBRARY} ${_curl_link_libraries})
set(CURL_VERSION_STRING "${CURL_VERSION}")

set(_curl_include_dirs)
set(_curl_link_libraries)
set(_curl_location_debug)
set(_curl_location_release)
endif()
1 change: 0 additions & 1 deletion ports/curlpp/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
)

configure_file(
${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake
${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}
@ONLY
)
Expand Down
35 changes: 0 additions & 35 deletions ports/curlpp/vcpkg-cmake-wrapper.cmake

This file was deleted.