aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/asio
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/asio')
-rw-r--r--vcpkg/ports/asio/CMakeLists.txt39
-rw-r--r--vcpkg/ports/asio/asio-config.cmake9
-rw-r--r--vcpkg/ports/asio/portfile.cmake27
-rw-r--r--vcpkg/ports/asio/vcpkg.json38
4 files changed, 113 insertions, 0 deletions
diff --git a/vcpkg/ports/asio/CMakeLists.txt b/vcpkg/ports/asio/CMakeLists.txt
new file mode 100644
index 0000000..ffbc3c7
--- /dev/null
+++ b/vcpkg/ports/asio/CMakeLists.txt
@@ -0,0 +1,39 @@
+cmake_minimum_required(VERSION 3.10)
+project(asio)
+
+add_library(asio INTERFACE)
+
+find_package(Threads)
+if(Threads_FOUND)
+ target_link_libraries(asio INTERFACE Threads::Threads)
+endif()
+
+# Export target
+install(TARGETS asio
+ EXPORT asio
+ INCLUDES DESTINATION include/
+)
+
+install(EXPORT asio
+ DESTINATION "share/asio"
+ FILE asio-targets.cmake
+ NAMESPACE asio::
+)
+
+install(DIRECTORY
+ asio/include/asio
+ DESTINATION include/
+ FILES_MATCHING
+ PATTERN "*.hpp"
+ PATTERN "*.ipp"
+)
+
+install(FILES
+ asio/include/asio.hpp
+ DESTINATION include/
+)
+
+set(exec_prefix [[${prefix}]])
+set(package_name [[asio]])
+configure_file(asio/asio.pc.in "${PROJECT_BINARY_DIR}/asio.pc" @ONLY)
+install(FILES "${PROJECT_BINARY_DIR}/asio.pc" DESTINATION share/pkgconfig)
diff --git a/vcpkg/ports/asio/asio-config.cmake b/vcpkg/ports/asio/asio-config.cmake
new file mode 100644
index 0000000..b916a00
--- /dev/null
+++ b/vcpkg/ports/asio/asio-config.cmake
@@ -0,0 +1,9 @@
+find_package(Threads)
+
+include("${CMAKE_CURRENT_LIST_DIR}/asio-targets.cmake")
+
+if(NOT TARGET asio)
+ add_library(asio ALIAS asio::asio)
+endif()
+
+get_target_property(ASIO_INCLUDE_DIR asio::asio INTERFACE_INCLUDE_DIRECTORIES)
diff --git a/vcpkg/ports/asio/portfile.cmake b/vcpkg/ports/asio/portfile.cmake
new file mode 100644
index 0000000..68b7874
--- /dev/null
+++ b/vcpkg/ports/asio/portfile.cmake
@@ -0,0 +1,27 @@
+set(VCPKG_BUILD_TYPE release) # header-only
+
+string(REPLACE "." "-" ref "asio-${VERSION}")
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO chriskohlhoff/asio
+ REF "${ref}"
+ SHA512 9374ff97bd4af7b5b41754970b2bcb468f450fee46a80c9c3344f732c64091f2ac5a73ebf4ac1831c623793c08a3c109ae90b601273c40d062bfd4f026f1d94d
+ HEAD_REF master
+)
+file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
+
+# Always use "ASIO_STANDALONE" to avoid boost dependency
+vcpkg_replace_string("${SOURCE_PATH}/asio/include/asio/detail/config.hpp" "defined(ASIO_STANDALONE)" "!defined(VCPKG_DISABLE_ASIO_STANDALONE)")
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DPACKAGE_VERSION=${VERSION}
+)
+vcpkg_cmake_install()
+vcpkg_fixup_pkgconfig()
+
+vcpkg_cmake_config_fixup()
+file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/asio-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/asio/LICENSE_1_0.txt")
diff --git a/vcpkg/ports/asio/vcpkg.json b/vcpkg/ports/asio/vcpkg.json
new file mode 100644
index 0000000..276b4ec
--- /dev/null
+++ b/vcpkg/ports/asio/vcpkg.json
@@ -0,0 +1,38 @@
+{
+ "name": "asio",
+ "version": "1.32.0",
+ "description": "Asio is a cross-platform C++ library for network and low-level I/O programming that provides developers with a consistent asynchronous model using a modern C++ approach.",
+ "homepage": "https://think-async.com/Asio/",
+ "documentation": "https://think-async.com/Asio/Documentation.html",
+ "license": "BSL-1.0",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "features": {
+ "coroutine": {
+ "description": "Boost.Coroutine (optional) if you use spawn() to launch coroutines",
+ "dependencies": [
+ "boost-coroutine"
+ ]
+ },
+ "openssl": {
+ "description": "OpenSSL (optional) if you use Asio's SSL support.",
+ "dependencies": [
+ "openssl"
+ ]
+ },
+ "regex": {
+ "description": "Boost.Regex (optional) if you use any of the read_until() or async_read_until() overloads that take a boost::regex parameter.",
+ "dependencies": [
+ "boost-regex"
+ ]
+ }
+ }
+}