aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/curlpp
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/curlpp')
-rw-r--r--vcpkg/ports/curlpp/fix-cmake.patch52
-rw-r--r--vcpkg/ports/curlpp/fix-findzliberror.patch9
-rw-r--r--vcpkg/ports/curlpp/obsolete-curlopt.diff14
-rw-r--r--vcpkg/ports/curlpp/portfile.cmake48
-rw-r--r--vcpkg/ports/curlpp/vcpkg.json22
5 files changed, 145 insertions, 0 deletions
diff --git a/vcpkg/ports/curlpp/fix-cmake.patch b/vcpkg/ports/curlpp/fix-cmake.patch
new file mode 100644
index 0000000..a7cd794
--- /dev/null
+++ b/vcpkg/ports/curlpp/fix-cmake.patch
@@ -0,0 +1,52 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 8b183a0..a801ae8 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -85,11 +85,12 @@ endif()
+
+ file(GLOB_RECURSE HeaderFileList "${CMAKE_CURRENT_SOURCE_DIR}/include/*")
+ file(GLOB_RECURSE SourceFileList "${CMAKE_CURRENT_SOURCE_DIR}/src/*")
++if(BUILD_SHARED_LIBS)
+ add_library(${PROJECT_NAME} SHARED ${HeaderFileList} ${SourceFileList})
+ target_link_libraries(${PROJECT_NAME} ${CURL_LIBRARIES} ${CONAN_LIBS})
+ set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION 1 VERSION 1.0.0)
+-
+-add_library(${PROJECT_NAME}_static STATIC ${HeaderFileList} ${SourceFileList})
++else()
++add_library(${PROJECT_NAME} STATIC ${HeaderFileList} ${SourceFileList})
+
+ # Make sure that on unix-platforms shared and static libraries have
+ # the same root name, but different suffixes.
+@@ -97,19 +98,28 @@ add_library(${PROJECT_NAME}_static STATIC ${HeaderFileList} ${SourceFileList})
+ # (solution taken from https://cmake.org/Wiki/CMake_FAQ#How_do_I_make_my_shared_and_static_libraries_have_the_same_root_name.2C_but_different_suffixes.3F)
+ #
+ # Making shared and static libraries have the same root name, but different suffixes
+-SET_TARGET_PROPERTIES(${PROJECT_NAME}_static PROPERTIES OUTPUT_NAME ${PROJECT_NAME})
++SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${PROJECT_NAME})
+ # Now the library target "curlpp_static" will be named "curlpp.lib" with MS tools.
+ # This conflicts with the "curlpp.lib" import library corresponding to "curlpp.dll",
+ # so we add a "lib" prefix (which is default on other platforms anyway):
+-SET_TARGET_PROPERTIES(${PROJECT_NAME}_static PROPERTIES PREFIX "lib")
+-target_link_libraries(${PROJECT_NAME}_static ${CURL_LIBRARIES} ${CONAN_LIBS})
++SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES PREFIX "lib")
++target_link_libraries(${PROJECT_NAME} CURL::libcurl)
++endif()
++
++target_include_directories(${PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:include>)
+
+ # install headers
+ install(DIRECTORY include/utilspp/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/utilspp")
+ install(DIRECTORY include/curlpp/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/curlpp")
+
+-install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_static
++install(TARGETS ${PROJECT_NAME}
++ EXPORT ${PROJECT_NAME}-config
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+
++install(EXPORT ${PROJECT_NAME}-config
++ FILE unofficial-${PROJECT_NAME}-config.cmake
++ NAMESPACE unofficial::${PROJECT_NAME}::
++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
++)
diff --git a/vcpkg/ports/curlpp/fix-findzliberror.patch b/vcpkg/ports/curlpp/fix-findzliberror.patch
new file mode 100644
index 0000000..4876d0f
--- /dev/null
+++ b/vcpkg/ports/curlpp/fix-findzliberror.patch
@@ -0,0 +1,9 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c42943c..12d402c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,3 +1,4 @@
++cmake_minimum_required(VERSION 2.8)
+ project(curlpp)
+
+
diff --git a/vcpkg/ports/curlpp/obsolete-curlopt.diff b/vcpkg/ports/curlpp/obsolete-curlopt.diff
new file mode 100644
index 0000000..c45f5ae
--- /dev/null
+++ b/vcpkg/ports/curlpp/obsolete-curlopt.diff
@@ -0,0 +1,14 @@
+diff --git a/include/curlpp/Options.hpp b/include/curlpp/Options.hpp
+index c705c9d..a658752 100644
+--- a/include/curlpp/Options.hpp
++++ b/include/curlpp/Options.hpp
+@@ -278,7 +278,9 @@ namespace options
+ typedef curlpp::OptionTrait<long, CURLOPT_LOW_SPEED_LIMIT> LowSpeedLimit;
+ typedef curlpp::OptionTrait<long, CURLOPT_LOW_SPEED_TIME> LowSpeedTime;
+ typedef curlpp::OptionTrait<long, CURLOPT_MAXCONNECTS> MaxConnects;
++#if LIBCURL_VERSION_NUM < 0x080a00
+ typedef curlpp::OptionTrait<curl_closepolicy, CURLOPT_CLOSEPOLICY> ClosePolicy;
++#endif
+ typedef curlpp::OptionTrait<bool, CURLOPT_FRESH_CONNECT> FreshConnect;
+ typedef curlpp::OptionTrait<bool, CURLOPT_FORBID_REUSE> ForbidReuse;
+ typedef curlpp::OptionTrait<long, CURLOPT_CONNECTTIMEOUT> ConnectTimeout;
diff --git a/vcpkg/ports/curlpp/portfile.cmake b/vcpkg/ports/curlpp/portfile.cmake
new file mode 100644
index 0000000..b700811
--- /dev/null
+++ b/vcpkg/ports/curlpp/portfile.cmake
@@ -0,0 +1,48 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO jpbarrette/curlpp
+ REF 8810334c830faa3b38bcd94f5b1ab695a4f05eb9
+ SHA512 47eb0738d7cd2d4262c455f9472a21535343bcf08bda6de19771dab9204e068272b41782c87057d50e3781683a29e79d6387577be68d175a7fa890367f15d0d2
+ HEAD_REF master
+ PATCHES
+ fix-cmake.patch
+ fix-findzliberror.patch
+ obsolete-curlopt.diff
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+)
+
+vcpkg_cmake_install()
+
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT} PACKAGE_NAME unofficial-${PORT})
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
+ file(REMOVE_RECURSE
+ "${CURRENT_PACKAGES_DIR}/bin"
+ "${CURRENT_PACKAGES_DIR}/debug/bin"
+ )
+endif()
+
+if(VCPKG_TARGET_IS_WINDOWS AND NOT (VCPKG_LIBRARY_LINKAGE STREQUAL static))
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/bin/curlpp-config" "${CURRENT_PACKAGES_DIR}" "`dirname $0`/..")
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/bin/curlpp-config" "${CURRENT_INSTALLED_DIR}" "$(prefix)" IGNORE_UNCHANGED)
+ if(NOT VCPKG_BUILD_TYPE)
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/bin/curlpp-config" "${CURRENT_PACKAGES_DIR}" "`dirname $0`/../..")
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/bin/curlpp-config" "${CURRENT_INSTALLED_DIR}" "$(prefix)" IGNORE_UNCHANGED)
+ endif()
+endif()
+
+vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/unofficial-curlpp/unofficial-curlpp-config.cmake"
+"# Generated by CMake"
+[[# Generated by CMake
+include(CMakeFindDependencyMacro)
+find_dependency(CURL)]])
+
+vcpkg_copy_pdbs()
+vcpkg_fixup_pkgconfig()
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/doc/LICENSE")
diff --git a/vcpkg/ports/curlpp/vcpkg.json b/vcpkg/ports/curlpp/vcpkg.json
new file mode 100644
index 0000000..40e0eeb
--- /dev/null
+++ b/vcpkg/ports/curlpp/vcpkg.json
@@ -0,0 +1,22 @@
+{
+ "name": "curlpp",
+ "version-date": "2018-06-15",
+ "port-version": 11,
+ "description": "C++ wrapper around libcURL",
+ "homepage": "https://github.com/jpbarrette/curlpp",
+ "license": "MIT",
+ "dependencies": [
+ {
+ "name": "curl",
+ "default-features": false
+ },
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}