-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add CMake Project #128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add CMake Project #128
Conversation
|
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. |
|
Ping. |
|
thank you! I like this |
|
Great! I'm not alone :-) |
c43f226 to
0257c67
Compare
|
Updated for latest master. @frozen4 can you check it? What OS and compiler you use? |
|
Hello @kdeforche! What about use this (when merged) in wt4? |
|
Ping. |
|
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? |
|
Hello @emweb! As wrote there:
I looked up your CMake project scripts and found no suitable instructions. In my proposal, I create exported IMPORTED interface library You can check (And I try link @chriskohlhoff, please support our discussion. |
|
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? |
|
For example see config.hpp. I think that |
|
@chriskohlhoff, ping. |
2 similar comments
|
@chriskohlhoff, ping. |
|
@chriskohlhoff, ping. |
|
Why did you not include the unit tests and the cpp03 examples? |
|
Hello @ClausKlein, |
|
Hi Konstantin,
based on your patch I have extended the CMakeLists.txt files to have more options and use ctest too:
Claus-MBP:ninjabuild clausklein$ ninja
[314/314] Linking CXX executable bin/asio_cpp14_executors_actor
Claus-MBP:ninjabuild clausklein$ ctest
Test project /Users/clausklein/Workspace/cpp/asio/ninjabuild
Start 1: asio_unit_buffer
1/48 Test #1: asio_unit_buffer ......................... Passed 0.02 sec
Start 2: asio_unit_buffered_read_stream
2/48 Test #2: asio_unit_buffered_read_stream ........... Passed 0.03 sec
Start 3: asio_unit_buffered_stream
3/48 Test #3: asio_unit_buffered_stream ................ Passed 0.01 sec
Start 4: asio_unit_buffered_write_stream
4/48 Test #4: asio_unit_buffered_write_stream .......... Passed 0.01 sec
Start 5: asio_unit_buffers_iterator
5/48 Test #5: asio_unit_buffers_iterator ............... Passed 0.12 sec
Start 6: asio_unit_coroutine
6/48 Test #6: asio_unit_coroutine ...................... Passed 0.02 sec
Start 7: asio_unit_error
7/48 Test #7: asio_unit_error .......................... Passed 0.03 sec
Start 8: asio_unit_generic_datagram_protocol
8/48 Test #8: asio_unit_generic_datagram_protocol ...... Passed 0.01 sec
Start 9: asio_unit_generic_raw_protocol
9/48 Test #9: asio_unit_generic_raw_protocol ........... Passed 0.01 sec
Start 10: asio_unit_generic_seq_packet_protocol
10/48 Test #10: asio_unit_generic_seq_packet_protocol .... Passed 0.01 sec
Start 11: asio_unit_generic_stream_protocol
11/48 Test #11: asio_unit_generic_stream_protocol ........ Passed 0.01 sec
Start 12: asio_unit_io_context
12/48 Test #12: asio_unit_io_context ..................... Passed 8.02 sec
Start 13: asio_unit_ip_address
13/48 Test #13: asio_unit_ip_address ..................... Passed 0.01 sec
Start 14: asio_unit_ip_address_v4
14/48 Test #14: asio_unit_ip_address_v4 .................. Passed 0.01 sec
Start 15: asio_unit_ip_address_v6
15/48 Test #15: asio_unit_ip_address_v6 .................. Passed 0.04 sec
Start 16: asio_unit_ip_host_name
16/48 Test #16: asio_unit_ip_host_name ................... Passed 0.01 sec
Start 17: asio_unit_ip_icmp
17/48 Test #17: asio_unit_ip_icmp ........................ Passed 0.01 sec
Start 18: asio_unit_ip_multicast
18/48 Test #18: asio_unit_ip_multicast ................... Passed 0.04 sec
Start 19: asio_unit_ip_network_v4
19/48 Test #19: asio_unit_ip_network_v4 .................. Passed 0.02 sec
Start 20: asio_unit_ip_network_v6
20/48 Test #20: asio_unit_ip_network_v6 .................. Passed 0.01 sec
Start 21: asio_unit_ip_tcp
21/48 Test #21: asio_unit_ip_tcp ......................... Passed 0.04 sec
Start 22: asio_unit_ip_udp
22/48 Test #22: asio_unit_ip_udp ......................... Passed 0.10 sec
Start 23: asio_unit_ip_unicast
23/48 Test #23: asio_unit_ip_unicast ..................... Passed 0.01 sec
Start 24: asio_unit_ip_v6_only
24/48 Test #24: asio_unit_ip_v6_only ..................... Passed 0.01 sec
Start 25: asio_unit_is_read_buffered
25/48 Test #25: asio_unit_is_read_buffered ............... Passed 0.01 sec
Start 26: asio_unit_is_write_buffered
26/48 Test #26: asio_unit_is_write_buffered .............. Passed 0.01 sec
Start 27: asio_unit_local_connect_pair
27/48 Test #27: asio_unit_local_connect_pair ............. Passed 0.01 sec
Start 28: asio_unit_local_datagram_protocol
28/48 Test #28: asio_unit_local_datagram_protocol ........ Passed 0.01 sec
Start 29: asio_unit_local_stream_protocol
29/48 Test #29: asio_unit_local_stream_protocol .......... Passed 0.01 sec
Start 30: asio_unit_posix_stream_descriptor
30/48 Test #30: asio_unit_posix_stream_descriptor ........ Passed 0.02 sec
Start 31: asio_unit_read
31/48 Test #31: asio_unit_read ........................... Passed 0.03 sec
Start 32: asio_unit_read_at
32/48 Test #32: asio_unit_read_at ........................ Passed 0.05 sec
Start 33: asio_unit_read_until
33/48 Test #33: asio_unit_read_until ..................... Passed 0.02 sec
Start 34: asio_unit_serial_port
34/48 Test #34: asio_unit_serial_port .................... Passed 0.01 sec
Start 35: asio_unit_serial_port_base
35/48 Test #35: asio_unit_serial_port_base ............... Passed 0.01 sec
Start 36: asio_unit_signal_set
36/48 Test #36: asio_unit_signal_set ..................... Passed 0.01 sec
Start 37: asio_unit_socket_base
37/48 Test #37: asio_unit_socket_base .................... Passed 0.01 sec
Start 38: asio_unit_strand
38/48 Test #38: asio_unit_strand ......................... Passed 8.03 sec
Start 39: asio_unit_streambuf
39/48 Test #39: asio_unit_streambuf ...................... Passed 0.01 sec
Start 40: asio_unit_system_timer
40/48 Test #40: asio_unit_system_timer ................... Passed 33.75 sec
Start 41: asio_unit_use_future
41/48 Test #41: asio_unit_use_future ..................... Passed 0.02 sec
Start 42: asio_unit_windows_object_handle
42/48 Test #42: asio_unit_windows_object_handle .......... Passed 0.03 sec
Start 43: asio_unit_windows_overlapped_ptr
43/48 Test #43: asio_unit_windows_overlapped_ptr ......... Passed 0.02 sec
Start 44: asio_unit_windows_random_access_handle
44/48 Test #44: asio_unit_windows_random_access_handle ... Passed 0.01 sec
Start 45: asio_unit_windows_stream_handle
45/48 Test #45: asio_unit_windows_stream_handle .......... Passed 0.01 sec
Start 46: asio_unit_write
46/48 Test #46: asio_unit_write .......................... Passed 0.04 sec
Start 47: asio_unit_write_at
47/48 Test #47: asio_unit_write_at ....................... Passed 0.04 sec
Start 48: asio_unit_ssl_stream
48/48 Test #48: asio_unit_ssl_stream ..................... Passed 0.04 sec
100% tests passed, 0 tests failed out of 48
Total Test time (real) = 50.92 sec
Claus-MBP:ninjabuild clausklein$
It works with each option on OSX, cygwin, VC2015, but not on MSYS!
I am still working on this.
Regards,
Claus
… On 18 Jul 2017, at 23:06, Konstantin Podsvirov ***@***.***> wrote:
Hello @ClausKlein <https://github.com/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 offline 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 <https://lists.boost.org/Archives/boost/2017/07/237248.php>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#128 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABv4WvoJUIOQw_jCMQMlwt2WegTyo8l6ks5sPR5JgaJpZM4JbzGx>.
|
|
@ClausKlein, thank you for your interest and efforts. |
0257c67 to
e789bc7
Compare
|
Rebased to |
|
@chriskohlhoff, any feedback please... :-( |
|
What is the status of this PR? I am currently looking at workarounds but this solution would be highly preferred. |
e789bc7 to
786b53b
Compare
|
Rebased to |
786b53b to
3148ad4
Compare
3148ad4 to
25f300c
Compare
|
Rebased to |
|
Hello @chriskohlhoff, what about paying attention to these changes? |
25f300c to
879f610
Compare
|
Rebased to |
|
I have based on your patch conan with cmake build files prepared, see |
Now implemented: - standalote installation as asio package; - export asio::standalone library; - optional building and installation cpp11 and cpp14 examples; - import from buildtree.
879f610 to
741c9ec
Compare
|
Rebased to |
|
Dear @chriskohlhoff, what you think about |
|
@chriskohlhoff any chance this gets merged soon? |
|
Would love to see this merged. CMake is awesome and would make integrating asio as easy as it gets. :) |
|
meanwhile using asio via conan which works perfectly: https://conan.io/center/asio/1.17.0 |
|
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... |
This PR make the project CMake "modern" compatible.
|
What is the progress? Does there have any possibility to add CMake support? |
if you are interested on a simple header only |
Thx, I'll take a look. |
|
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 |
|
I suggest to make a distinct repo like we made for "QR-Code-Generator" lib or pdfium and another libs for ease of packaging |
|
According to boostorg/cmake#24 (comment), Boost is ready to support using CMake with |
|
@chriskohlhoff I really hope adding CMake support to this Asio library will be done in 2024.. Either via this PR or another |
|
I have an updated version here: ClausKlein#4 |
Now implemented:
Usage standalone asio from CMake projects:
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