v-kiniv / rws

WebSocket gateway for ROS2 topics and services
Apache License 2.0
8 stars 4 forks source link

Use system libraries for dependencies #3

Open zflat opened 1 year ago

zflat commented 1 year ago

Right now, RWS is using websocketpp, asio and nlohmann/json and these 3 libraries will be fetched by CMake during configuration step. Is there a reason they need to be built like this? Can the libraries installable via apt work?

You can add the following to the package.xml file

<build_depend>asio</build_depend>
<build_depend>nlohmann-json-dev</build_depend>
<build_depend>libwebsocketpp-dev</build_depend>

Then the rosdep tool can be used to install the correct packages from apt. Note that the rosdep tool works for other linux distributions than just Ubuntu.

Maybe you can also change the CMakeLists.txt to attempt to find_package and if it fails to find a package then fetch and build? I also think that automatic fetching and building should be an option that is disabled by default.

v-kiniv commented 1 year ago

rosdep is not working on Mac, also asio and websocketpp are a bit outdated on Ubuntu 20.04, that was the reasons, but I agree that automatic fetching should be optional.