-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [asio] Add cmake target * [asio] Export both asio and asio::asio * [asio] Also export include dir variable
- Loading branch information
Showing
4 changed files
with
55 additions
and
8 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,33 @@ | ||
cmake_minimum_required(VERSION 3.8) | ||
project(asio) | ||
|
||
add_library(asio INTERFACE) | ||
|
||
# Always use "ASIO_STANDALONE" to avoid boost dependency | ||
file(READ "asio/include/asio/detail/config.hpp" _contents) | ||
string(REPLACE "defined(ASIO_STANDALONE)" "!defined(VCPKG_DISABLE_ASIO_STANDALONE)" _contents "${_contents}") | ||
file(WRITE "asio/include/asio/detail/config.hpp" "${_contents}") | ||
|
||
# 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 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,3 +1,3 @@ | ||
Source: asio | ||
Version: 1.12.2 | ||
Version: 1.12.2-1 | ||
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. |
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,6 @@ | ||
include ("${CMAKE_CURRENT_LIST_DIR}/asio-targets.cmake") | ||
add_library(asio::asio INTERFACE IMPORTED) | ||
target_link_libraries(asio::asio INTERFACE asio) | ||
|
||
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