-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
97 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
cmake_minimum_required(VERSION 3.8) | ||
project(asio) | ||
|
||
add_library(asio INTERFACE) | ||
|
||
# Export target | ||
install(TARGETS asio | ||
EXPORT asio | ||
INCLUDES DESTINATION include/ | ||
) | ||
|
||
install(EXPORT asio | ||
DESTINATION "share/asio" | ||
FILE asio-targets.cmake | ||
) | ||
|
||
install(DIRECTORY | ||
asio/include/asio | ||
DESTINATION include/ | ||
FILES_MATCHING | ||
PATTERN "*.hpp" | ||
PATTERN "*.ipp" | ||
) | ||
|
||
install(FILES | ||
asio/include/asio.hpp | ||
DESTINATION include/ | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
include ("${CMAKE_CURRENT_LIST_DIR}/asio-targets.cmake") | ||
|
||
if(NOT TARGET asio::asio) | ||
add_library(asio::asio INTERFACE IMPORTED) | ||
target_link_libraries(asio::asio INTERFACE asio) | ||
endif() | ||
|
||
get_target_property(_ASIO_INCLUDE_DIR asio INTERFACE_INCLUDE_DIRECTORIES) | ||
set(ASIO_INCLUDE_DIR "${_ASIO_INCLUDE_DIR}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,29 @@ | ||
#header-only library | ||
vcpkg_download_distfile( | ||
ARCHIVE_FILE | ||
URLS "https://netix.dl.sourceforge.net/project/asio/asio/1.12.2%20%28Stable%29/asio-1.12.2.zip" | ||
FILENAME "asio-1.12.2.zip" | ||
SHA512 f0e945a7c7bc25c15b375b76f3aaff7c6c2c2ca981d1ee207990d14425b23aee2365d295ae78c216b67d6f70cc9d99a8558a879f5c2cd882dc91f56e7e643cc4 | ||
) | ||
|
||
vcpkg_extract_source_archive( | ||
${ARCHIVE_FILE} | ||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO chriskohlhoff/asio | ||
REF asio-1-30-2 | ||
SHA512 cfba1998d4f666156e751c4cab1e504441b368efbf344e22de30f8b983670a88d045d3ca82f197b95522a2026262274f93bc3061210781ce30c35c71a386ce6e | ||
HEAD_REF master | ||
) | ||
|
||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/asio-1.12.2) | ||
# 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)") | ||
|
||
# Handle copyright | ||
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) | ||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright) | ||
# CMake install | ||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") | ||
vcpkg_cmake_configure( | ||
SOURCE_PATH "${SOURCE_PATH}" | ||
) | ||
vcpkg_cmake_install() | ||
|
||
# Copy the asio header files | ||
file(INSTALL ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR} FILES_MATCHING PATTERN "*.hpp" PATTERN "*.ipp") | ||
vcpkg_cmake_config_fixup() | ||
file(INSTALL | ||
"${CMAKE_CURRENT_LIST_DIR}/asio-config.cmake" | ||
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" | ||
) | ||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug") | ||
|
||
# Always use "ASIO_STANDALONE" to avoid boost dependency | ||
file(READ "${CURRENT_PACKAGES_DIR}/include/asio/detail/config.hpp" _contents) | ||
string(REPLACE "defined(ASIO_STANDALONE)" "!defined(VCPKG_DISABLE_ASIO_STANDALONE)" _contents "${_contents}") | ||
file(WRITE "${CURRENT_PACKAGES_DIR}/include/asio/detail/config.hpp" "${_contents}") | ||
# Handle copyright | ||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/asio/LICENSE_1_0.txt") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"name": "asio", | ||
"version": "1.30.2", | ||
"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://github.com/chriskohlhoff/asio", | ||
"documentation": "https://think-async.com/Asio/asio-1.28.0/doc/", | ||
"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" | ||
] | ||
} | ||
} | ||
} |