Skip to content

Add CMake Project#128

Open
podsvirov wants to merge 1 commit into
chriskohlhoff:masterfrom
podsvirov:topic-cmake-project
Open

Add CMake Project#128
podsvirov wants to merge 1 commit into
chriskohlhoff:masterfrom
podsvirov:topic-cmake-project

Conversation

@podsvirov

@podsvirov podsvirov commented Aug 3, 2016

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor Author

Ping.

@frozen4

frozen4 commented Dec 2, 2016

Copy link
Copy Markdown

thank you! I like this

@podsvirov

Copy link
Copy Markdown
Contributor Author

Great! I'm not alone :-)

@podsvirov

podsvirov commented Dec 24, 2016

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Contributor Author

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

@podsvirov

Copy link
Copy Markdown
Contributor Author

Ping.

@emweb

emweb commented Jan 25, 2017

Copy link
Copy Markdown

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
Copy Markdown
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

emweb commented Jan 26, 2017

Copy link
Copy Markdown

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
Copy Markdown
Contributor Author

For example see config.hpp.

I think that ASIO_STANDALONE it is very important variable.

@podsvirov

Copy link
Copy Markdown
Contributor Author

@chriskohlhoff, ping.

2 similar comments
@podsvirov

Copy link
Copy Markdown
Contributor Author

@chriskohlhoff, ping.

@podsvirov

Copy link
Copy Markdown
Contributor Author

@chriskohlhoff, ping.

@ClausKlein

ClausKlein commented Jul 18, 2017

Copy link
Copy Markdown

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

@podsvirov

podsvirov commented Jul 18, 2017

Copy link
Copy Markdown
Contributor Author

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

ClausKlein commented Jul 19, 2017 via email

Copy link
Copy Markdown

@podsvirov

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

@podsvirov

Copy link
Copy Markdown
Contributor Author

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

@hgaiser

hgaiser commented Nov 1, 2017

Copy link
Copy Markdown

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
Copy Markdown
Contributor Author

Rebased to master.

@podsvirov

Copy link
Copy Markdown
Contributor Author

Rebased to master.

@podsvirov

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

Rebased to master.

@ClausKlein

Copy link
Copy Markdown

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
Copy Markdown
Contributor Author

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

@podsvirov

Copy link
Copy Markdown
Contributor Author

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

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

gocarlos commented Dec 11, 2018

Copy link
Copy Markdown

@chriskohlhoff any chance this gets merged soon?

@marcj

marcj commented Aug 15, 2020

Copy link
Copy Markdown

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

@gocarlos

Copy link
Copy Markdown

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

@deepbluev7

Copy link
Copy Markdown

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

@podsvirov

Copy link
Copy Markdown
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
Copy Markdown

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

@ClausKlein

Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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

melroy89 commented Jan 3, 2024

Copy link
Copy Markdown
Contributor

@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
Copy Markdown

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.