I want to use uWebSockets for my own project which uses CMake.
There are two issues for me:
- uWebSocket uses Make as well as I think its own build system/file build.c?
- It depends itself on other libraries of which some use CMake others Make.
I would be happy if I can make it work with CMake even if not all of the project's possibilities are reflected, e.g. building examples or linking optional dependencies like boost asio for uSockets (one of its dependencies).
Is it possible to fetch the libraries via CMake's FetchContent? Note, uWebSockets has its dependency uSocket setup as a git submodule.
Does it make sense instead of rewriting the whole Makefiles in CMake to rather just call make from within CMake?
Regarding Conan: it throws an error which I am also not sure how to fix (cannot find MSBuild python package on linux?):
ERROR: Package 'usockets/0.8.5' not resolved: usockets/0.8.5: Cannot load recipe.
Error loading conanfile at '/home/<USER>/.conan2/p/usock995f8272b80d4/e/conanfile.py': Unable to load conanfile in /home/<USER>/.conan2/p/usock995f8272b80d4/e/conanfile.py
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/<USER>/.conan2/p/usock995f8272b80d4/e/conanfile.py", line 7, in <module>
from conans import MSBuild, AutoToolsBuildEnvironment
ImportError: cannot import name 'MSBuild' from 'conans' (/usr/lib/python3.10/site-packages/conans/__init__.py)
PS: The uWebSocket project does not have a Getting Started guide and the maintainers are not open for any other build system than Make.
PSS: I found this discussion about a CMake integration. Though I am not sure if it is still up to date or longer than it needs to be.