ROS2 package -> missing library

Completed

Hi,

I'm trying to build a ROS2 package in CLion and I get a missing dependency: "Could NOT find FastRTPS (missing: FastRTPS_INCLUDE_DIR FastRTPS_LIBRARIES)."

CLion is launched from a shell with sourced ros2 setup.bash.

The ROS2 package builds fine when using a "colcon build" command and the paths are being assign to: FastRTPS_INCLUDE_DIR:PATH=/opt/ros/crystal/include    and    FastRTPS_LIBRARY_RELEASE:FILEPATH=/opt/ros/crystal/lib/libfastrtps.so

Let me know how I can point CLion to the library in order to build the package.

Thanks

0
3 comments

I was able to get it going by adding CMake options to the project as follows:

-DFastRTPS_INCLUDE_DIR:PATH=/opt/ros/crystal/include -DFastRTPS_LIBRARY_RELEASE:FILEPATH=/opt/ros/crystal/lib/libfastrtps.so

Let me know if it's the right way or there is a more elegant solution.

 

Cheers

0

Hi, @Vadbut! It's a right way to set variables. Alternatively you can set them directly in the CMakeLists.txt like

set(FastRTPS_INCLUDE_DIR:PATH /opt/ros/crystal/include)
0

Please sign in to leave a comment.