diff options
| author | Ankush Singh <11595119+thewisebro@users.noreply.github.com> | 2020-06-02 07:40:23 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-01 19:10:23 -0700 |
| commit | f5676127ee28ade462b01e6f969689fc8dece3ae (patch) | |
| tree | 1ba613730da542791ab7eb3c6a836a72ec5e955d | |
| parent | e7041e1ef6f61ef01cee0eed90308930258ba457 (diff) | |
| download | vcpkg-f5676127ee28ade462b01e6f969689fc8dece3ae.tar.gz vcpkg-f5676127ee28ade462b01e6f969689fc8dece3ae.zip | |
[sockpp] Add new port (#11562)
* [sockpp] Add new port
* [sockpp] Address review comments
* [sockpp] Update ci.baseline
* [sockpp] Fix typo
* [sockpp] Fix sockppConfig.cmake
| -rw-r--r-- | ports/sockpp/CONTROL | 5 | ||||
| -rw-r--r-- | ports/sockpp/portfile.cmake | 32 | ||||
| -rw-r--r-- | ports/sockpp/sockppConfig.cmake | 23 | ||||
| -rw-r--r-- | ports/sockpp/usage | 5 | ||||
| -rw-r--r-- | scripts/ci.baseline.txt | 2 |
5 files changed, 67 insertions, 0 deletions
diff --git a/ports/sockpp/CONTROL b/ports/sockpp/CONTROL new file mode 100644 index 000000000..90ad9f787 --- /dev/null +++ b/ports/sockpp/CONTROL @@ -0,0 +1,5 @@ +Source: sockpp +Version: 0.7 +Homepage: https://github.com/fpagliughi/sockpp +Description: Simple, modern, C++ socket library. This is a fairly low-level C++ wrapper around the Berkeley sockets library using socket, acceptor, and connector classes that are familiar concepts from other languages. +Supports: !uwp diff --git a/ports/sockpp/portfile.cmake b/ports/sockpp/portfile.cmake new file mode 100644 index 000000000..19b43486e --- /dev/null +++ b/ports/sockpp/portfile.cmake @@ -0,0 +1,32 @@ +vcpkg_fail_port_install(ON_TARGET "uwp") +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO fpagliughi/sockpp + REF d8c86c01db43542a06ad05424da037f6b9892253 + SHA512 9b7ae3fea08bfd4a0d6479d7fbcc24da9101476c4f8e4a684138c7d974827cdf374282a4641e58f03c08aeb83f2c1856fc3c5193e5847fb4b3d9182c1c396087 + HEAD_REF master +) + +vcpkg_replace_string(${SOURCE_PATH}/CMakeLists.txt "\${SOCKPP}-static" "\${SOCKPP}") + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DSOCKPP_BUILD_SHARED=OFF + -DSOCKPP_BUILD_STATIC=ON + -DSOCKPP_BUILD_DOCUMENTATION=OFF + -DSOCKPP_BUILD_EXAMPLES=OFF + -DSOCKPP_BUILD_TESTS=OFF +) + +vcpkg_install_cmake() + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${CURRENT_PORT_DIR}/sockppConfig.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) diff --git a/ports/sockpp/sockppConfig.cmake b/ports/sockpp/sockppConfig.cmake new file mode 100644 index 000000000..840b96ed0 --- /dev/null +++ b/ports/sockpp/sockppConfig.cmake @@ -0,0 +1,23 @@ +get_filename_component(_DIR "${CMAKE_CURRENT_LIST_DIR}/../../" ABSOLUTE) +if(NOT SOCKPP_FIND_COMPONENTS) + set(SOCKPP_FIND_COMPONENTS sockpp) + if(SOCKPP_FIND_REQUIRED) + set(SOCKPP_FIND_REQUIRED_sockpp TRUE) + endif() + set(SOCKPP_FOUND TRUE) +endif() + +set(SOCKPP_INCLUDE_DIRS ${_DIR}/include) +set(SOCKPP_LIBRARIES) +if (EXISTS ${_DIR}/lib/libsockpp.a) + list(APPEND SOCKPP_LIBRARIES optimized ${_DIR}/lib/libsockpp.a) +endif() +if (EXISTS ${_DIR}/debug/lib/libsockpp.a) + list(APPEND SOCKPP_LIBRARIES debug ${_DIR}/debug/lib/libsockpp.a) +endif() +if (EXISTS ${_DIR}/lib/sockpp.lib) + list(APPEND SOCKPP_LIBRARIES optimized ${_DIR}/lib/sockpp.lib) +endif() +if (EXISTS ${_DIR}/debug/lib/sockpp.lib) + list(APPEND SOCKPP_LIBRARIES debug ${_DIR}/debug/lib/sockpp.lib) +endif() diff --git a/ports/sockpp/usage b/ports/sockpp/usage new file mode 100644 index 000000000..5cfb06d29 --- /dev/null +++ b/ports/sockpp/usage @@ -0,0 +1,5 @@ +The package sockpp provides CMake integration:
+
+ find_package(sockpp CONFIG REQUIRED)
+ target_include_directories(main PRIVATE ${SOCKPP_INCLUDE_DIRS})
+ target_link_libraries(main PRIVATE ${SOCKPP_LIBRARIES})
diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 6d0334abd..700df9d8e 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -1714,6 +1714,8 @@ smpeg2:x64-linux=fail smpeg2:x64-uwp=fail
soci:arm-uwp=fail
soci:x64-uwp=fail
+sockpp:arm-uwp=fail
+sockpp:x64-uwp=fail
soem:x64-uwp=fail
soem:arm-uwp=fail
soil:arm-uwp=fail
|
