TheLartians / ModernCppStarter

🚀 Kick-start your C++! A template for modern C++ projects using CMake, CI, code coverage, clang-format, reproducible dependency management and much more.
https://thelartians.github.io/ModernCppStarter
The Unlicense
4.43k stars 386 forks source link

Having a issue when adding asio to my project using this template #174

Closed tanja84dk closed 1 year ago

tanja84dk commented 1 year ago

Hello

I thought I would give this template a chance but I'm unfortunally having issue when the project needs asio

I'm pulling in asio with CPM as I always do with the extra configuration that is listed in the CPM example, but unfortunally since asio don't distribute as a cmake project then I'm facing this issue when trying to add it

CMake Error: install(EXPORT "tanja84dk_httplibTargets" ...) includes target "tanja84dk_httplib" which requires target "asio" that is not in any export set.

I'm using this way to include it except updated up to the newest version https://github.com/cpm-cmake/CPM.cmake/blob/master/examples/asio-standalone/CMakeLists.txt

Is there a way I'm able to work around it?

ClausKlein commented 1 year ago

https://discourse.cmake.org/t/cmake-error-install-export-projecttargets-includes-target-xxx-which-requires-target-yyy-that-is-not-in-any-export-set/7344

tanja84dk commented 1 year ago

https://discourse.cmake.org/t/cmake-error-install-export-projecttargets-includes-target-xxx-which-requires-target-yyy-that-is-not-in-any-export-set/7344

Unfortunally looking at that thread does not help me alot actually got me more confused about it unfortunally specially its first time I'm trying the template ( and PackageProject.cmake since the template rely on it )

Also unfortunally I'm stuck on cmake version 3.22.1 since that is the newest in my build containers version and in that link it talks about cmake 3.26

And also the thing that asio it self doesn't have a CMakeLists.txt also doesn't help me because I have to rely on the examples from CPM

ClausKlein commented 1 year ago

You have to install all packages you depend on.

Try to use this https://github.com/chriskohlhoff/asio/pull/1105 asio Version!

tanja84dk commented 1 year ago

No thanks I will not use your branch since its not verifyed by asio's author since its actually imposible to see what version its made for since your branch were started last year, and also gobs as you use in your branch are really no no go

And tbh I chose this night to literally dropped this template completely and gone back to only use CPM because all the issues is started here after I tried to use this template

tanja84dk commented 1 year ago

closed

ClausKlein commented 1 year ago

Your Problems has nothing to do with this Template.

I would use boost::asio and cmake.init Python module. And read the docs😉

tanja84dk commented 1 year ago

Well as soon I went back to the original way I always have made cmake files then it works fine even with asio and importing in with CPMAddPackage so yes its purely in this template or in the PackageProject ( also from TheLartians ) there gives me the issue.

And no I will never use boost at all! It's so bloated, poorly maintained lots of extremely outdated libraries and I always only want to incldude the things I actually need and not to include several gigabytes for only one thing ( also boost versions are deference from system to system )!!

But again as you saw I closed it because I do still stand that its ether ModernCppStarter or PackageProject there is making the issue witch is why I'm dropping it totally

ClausKlein commented 1 year ago

Try this, it works:

https://github.com/ClausKlein/ModernCmakeStarter/pull/7/files

tanja84dk commented 1 year ago

@ClausKlein Why the fuck cant you take a question is closed and just leave it!!!

TheLartians commented 1 year ago

@tanja84dk I'm sorry you're having issues with the template, however insults and personal attacks are not acceptable in this repository. The issue is now locked.