Giter Club home page Giter Club logo

asio.cmake's People

Contributors

clausklein avatar olivierldff avatar windowsair avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

asio.cmake's Issues

Support find_package(asio MODULE) with FindAsio.cmake

Hello,

Thanks for adding the CMake support here since it seems the core asio team does not want any CMake code in their repo.

Have you considered adding support for consuming asio in a CMake based project with a call to find_package(asio MODULE REQUIRED)? To do that, one would need to add a FindAsio.cmake script to this repo, perhaps in the existing cmake folder.

Although CMake module scripts aren't as good as config scripts, it still meets the use case that one as asio installed in their system headers. For example, on Ubuntu 22.04, I can install libasio-dev, use fetchContent to get this repo, add the cmake folder to CMAKE_MODULE_PATH. This provides the advantage of my source tree only getting to use one version of asio - the one installed in the system headers. Tools like FetchContent and CPM enable you to fetch different versions of the same library in multiple different libraries, which can be problematic.

Furthermore, the CMake module script could support version checking, through a simple re-use of the version parsing you have already implemented. For example, this can guarantee that the located version of asio is exactly 1.18.1.
find_package(ASIO 1.18.1 EXACT MODULE REQUIRED)

A contrived example: https://github.com/ros-drivers/transport_drivers/blob/main/asio_cmake_module/cmake/Modules/FindASIO.cmake

Would you be willing to accept a PR that adds this capability?

Best,
Ryan

support mingw

https://stackoverflow.com/a/58365352
The first method is working. But in windows for mingw need to add link_libraries(ws2_32 wsock32) after include_directories(${asio_SOURCE_DIR}/asio/include/). In linux need add:SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DASIO_STANDALONE -pthread").

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.