Skip to content

Conversation

@podsvirov
Copy link
Contributor

@podsvirov podsvirov commented Aug 3, 2016

Now implemented:

  • standalote installation as asio package;
  • optional building and installation cpp11 and cpp14 examples.

Usage standalone asio from CMake projects:

find_package(asio REQUIRED)
target_link_libraries(<target_name> asio::standalone)

Prebuid asio_cpp11_xxx and asio_cpp14_xxx examples available for testing from DaD's House by MinGW-w64 based installers:

dad-0.3.1-windows-mingw32-testing.exe

and

dad-0.3.1-windows-mingw64-testing.exe

@podsvirov
Copy link
Contributor Author

Hello @chriskohlhoff,

you have the time and can see my changes?

Your library is stable, but my goal is the propaganda and popularization of the use of standalone library among the community CMake users.

@podsvirov
Copy link
Contributor Author

Ping.

@frozen4
Copy link

frozen4 commented Dec 2, 2016

thank you! I like this

@podsvirov
Copy link
Contributor Author

Great! I'm not alone :-)

@podsvirov
Copy link
Contributor Author

podsvirov commented Dec 24, 2016

Updated for latest master.

@frozen4 can you check it? What OS and compiler you use?

@podsvirov podsvirov mentioned this pull request Jan 13, 2017
@podsvirov
Copy link
Contributor Author

Hello @kdeforche! What about use this (when merged) in wt4?

@podsvirov
Copy link
Contributor Author

Ping.

@emweb
Copy link

emweb commented Jan 25, 2017

Hey! In wt4 we added recently an option to use non-boost asio instead of boost asio. However, as I understand it, we only need header files, and thus not really a particular build system.

Or what are you hinting at?

@podsvirov
Copy link
Contributor Author

Hello @emweb!

As wrote there:

To use Asio in this way, define ASIO_STANDALONE on your compiler command line or as part of the project options.

I looked up your CMake project scripts and found no suitable instructions.

In my proposal, I create exported IMPORTED interface library asio::standalone - when you link to the target in your project, it automatically adjusts the path to the headers and define the ASIO_STANDALONE preprocessor variable.

You can check ASIO_STANDALONE definition in your C++ code to select boost or standalone Asio version and your do not need define additional custom settings variable like WT_ASIO_IS_BOOST_ASIO or WT_ASIO_IS_STANDALONE_ASIO.

(And I try link wt4 to Asio from master and it not compatible now)

@chriskohlhoff, please support our discussion.

@emweb
Copy link

emweb commented Jan 26, 2017

If you want to build Wt 4 (the wt4 branch, master is still Wt 3) with the standalone version of asio, you have to set -DWT_ASIO_IMPLEMENTATION to "standalone" and set -DASIO_PREFIX correctly. I think that should be sufficient?

@podsvirov
Copy link
Contributor Author

For example see config.hpp.

I think that ASIO_STANDALONE it is very important variable.

@podsvirov
Copy link
Contributor Author

@chriskohlhoff, ping.

2 similar comments
@podsvirov
Copy link
Contributor Author

@chriskohlhoff, ping.

@podsvirov
Copy link
Contributor Author

@chriskohlhoff, ping.

@ClausKlein
Copy link

ClausKlein commented Jul 18, 2017

Why did you not include the unit tests and the cpp03 examples?

@podsvirov
Copy link
Contributor Author

podsvirov commented Jul 18, 2017

Hello @ClausKlein,
at the moment, only the standalone version of the library is supported (without Boost dependencies).
As far as I know, cpp03 examples can not be built with an standalone version of the library.
The Boost library support is possible in the future, but I had to start somewhere. With something that has not happened yet (easy using standalone asio from CMake projects).
By the way, today I learned the news that the Boost library is moving to the CMake build system:
https://lists.boost.org/Archives/boost/2017/07/237248.php

@ClausKlein
Copy link

ClausKlein commented Jul 19, 2017 via email

@podsvirov
Copy link
Contributor Author

@ClausKlein, thank you for your interest and efforts.
I created these changes about a year ago, but there is still no reaction from @chriskohlhoff...

@podsvirov podsvirov force-pushed the topic-cmake-project branch from 0257c67 to e789bc7 Compare August 16, 2017 18:03
@podsvirov
Copy link
Contributor Author

Rebased to master and updated list of public files to install.

@podsvirov
Copy link
Contributor Author

@chriskohlhoff, any feedback please... :-(

@hgaiser
Copy link

hgaiser commented Nov 1, 2017

What is the status of this PR? I am currently looking at workarounds but this solution would be highly preferred.

@podsvirov podsvirov force-pushed the topic-cmake-project branch from e789bc7 to 786b53b Compare November 1, 2017 19:25
@podsvirov
Copy link
Contributor Author

Rebased to master.

@podsvirov
Copy link
Contributor Author

Rebased to master.

@podsvirov
Copy link
Contributor Author

Hello @chriskohlhoff, what about paying attention to these changes?

@podsvirov podsvirov force-pushed the topic-cmake-project branch from 25f300c to 879f610 Compare April 1, 2018 01:39
@podsvirov
Copy link
Contributor Author

Rebased to master.

@ClausKlein
Copy link

I have based on your patch conan with cmake build files prepared, see
#296

Now implemented:
- standalote installation as asio package;
- export asio::standalone library;
- optional building and installation cpp11 and cpp14 examples;
- import from buildtree.
@podsvirov podsvirov force-pushed the topic-cmake-project branch from 879f610 to 741c9ec Compare June 16, 2018 07:51
@podsvirov
Copy link
Contributor Author

Rebased to master.
Add support for import package from buildtree.

@podsvirov
Copy link
Contributor Author

Dear @chriskohlhoff, what you think about CMake and about this PR?

@MikeGitb MikeGitb mentioned this pull request Aug 25, 2018
@gocarlos
Copy link

gocarlos commented Dec 11, 2018

@chriskohlhoff any chance this gets merged soon?

@marcj
Copy link

marcj commented Aug 15, 2020

Would love to see this merged. CMake is awesome and would make integrating asio as easy as it gets. :)

@gocarlos
Copy link

meanwhile using asio via conan which works perfectly: https://conan.io/center/asio/1.17.0

@deepbluev7
Copy link

Have you tried asking for a review on the mailing list or so? CMake support would be very useful to me!

@podsvirov
Copy link
Contributor Author

Have you tried asking for a review on the mailing list or so? CMake support would be very useful to me!

No. I have not made such attempts.

@chriskohlhoff reacts on other topics, but there is silence. I think this is his principled position...

@ClausKlein ClausKlein mentioned this pull request Nov 12, 2020
nebatmusic pushed a commit to nebatmusic/asio that referenced this pull request Nov 16, 2020
This PR make the project CMake "modern" compatible.
@fakecore
Copy link

What is the progress? Does there have any possibility to add CMake support?

@ClausKlein
Copy link

What is the progress? Does there have any possibility to add CMake support?

if you are interested on a simple header only cmake solution, you may try this: ClausKlein#3

@fakecore
Copy link

What is the progress? Does there have any possibility to add CMake support?

if you are interested on a simple header only cmake solution, you may try this: ClausKlein#3

Thx, I'll take a look.

@robbert-vdh
Copy link

Any chance of this being merged soon? Since the standalone asio doesn't come with either a simple pkgconfig file or a CMake build definition, the dependency("asio") in my Meson project can't find asio. I'll work around it by having a dedicated build option for using system asio, but this is kind of a problem when packaging software for distro repos.

@leha-bot
Copy link

I suggest to make a distinct repo like we made for "QR-Code-Generator" lib or pdfium and another libs for ease of packaging

@hwhsu1231
Copy link

According to boostorg/cmake#24 (comment), Boost is ready to support using CMake with find_package() in CONFIG mode in release 1.82. Hope this Boost-independent Asio can do so as well.

@melroy89
Copy link
Contributor

melroy89 commented Jan 3, 2024

@chriskohlhoff I really hope adding CMake support to this Asio library will be done in 2024.. Either via this PR or another

@ClausKlein
Copy link

I have an updated version here: ClausKlein#4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.