Code Monkey home page Code Monkey logo

asio.cmake's Introduction

Asio.cmake

πŸ‘· compilation

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

πŸš€ How to use

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)

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_REPOSITORY: From where asio will be downloaded. Default https://github.com/chriskohlhoff/asio

  • ASIO_TAG: Tag of asio that will be used. Default: master

  • ASIO_USE_CPM: Download Asio with CPM instead of FetchContent. Default: OFF

  • ASIO_CPM_FETCHCONTENT_COMPAT: Stay compatible in a build that use FetchContent when using CPM. Default ON

    • It is recommended to set it OFF when using CPM, in order to use CPM_SOURCE_CACHE
  • ASIO_ENABLE_EXAMPLES: Add asio examples. Default: PROJECT_IS_TOP_LEVEL

  • ASIO_ENABLE_INSTALL: Install asio target. Default: PROJECT_IS_TOP_LEVEL

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:

  • Linux
    • gcc 4.8 or later
    • clang 3.0 or later
  • macOS
    • Xcode8 or later using bundled clang
  • Windows
    • Visual C++ 2013 or later
  • FreeBSD
    • gcc 6.0 or later

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.