OlivierLDff / asio.cmake

Small CMake wrapper to add asio with a simple FetchContent.
MIT License
18 stars 9 forks source link
asio cmake cpm fetchcontent

Asio.cmake

👷 compilation

CMake wrapper to add asio with a simple FetchContent as a static library.

🚀 How to use

FetchContent

Use FetchContent to add this repository in your cmake script.

# Force the script to use FetchContent and not CPM internally to fetch asio
option(ASIO_USE_CPM "Download Asio with CPM instead of FetchContent" OFF)
option(
  ASIO_CPM_FETCHCONTENT_COMPAT
  "Should asio be declared with FetchContent functions to be compatible. This doesn't not allow CPM cache to work."
  ON
)
# Download this repository
include(FetchContent)
FetchContent_Declare(
  asiocmake
  GIT_REPOSITORY "https://github.com/OlivierLDff/asio.cmake"
  GIT_TAG        "main"
)
FetchContent_MakeAvailable(asiocmake)

# ...

# Link to the created library asio::asio or asio
target_link_libraries(myapp PRIVATE asio::asio)

CPM

Or with CPM even an easier integration.

include(cmake/CPM.cmake)

CPMAddPackage(
  NAME asiocmake
  GIT_REPOSITORY "https://github.com/OlivierLDff/asio.cmake"
  GIT_TAG "main"
)

# ...

# Link to the created library asio::asio or asio
target_link_libraries(myapp PRIVATE asio::asio)

Customization

Asio

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.

What does Asio provide?

Asio provides the basic building blocks for C++ networking, concurrency and other kinds of I/O.

What kind of applications can use Asio?

Asio is used in all kinds of applications, from phone apps to the world’s fastest share markets.

Here is a list of some applications that use Asio.

Supported Platforms

Asio is regularly tested with the following platforms:

More…

📄 License

MIT License

Copyright (c) 2021 Olivier Le Doeuff

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Asio is released under the Boost Software License.

👥 Authors