ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I want to answer my own question, to clarify which way I found and what is the proper as I consider.

Basically, you have to add folder with header files and the library itself. You can do it with find_package, or manually.

The header files you have to include in "include_libraries" like I did:

include_directories(

include

${catkin_INCLUDE_DIRS} ${Qt5Core_INCLUDE_DIRS} ${Qt5WebSockets_INCLUDE_DIRS} /usr/include )

And the library itself, you can add with "target_link_libraries", like this:

add_executable(driver src/driver_node.cpp) target_link_libraries(driver ${catkin_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} /usr/lib/aarch64-linux-gnu/libserial.so)

I want to answer my own question, to clarify which way I found and what is the proper as I consider.

Basically, you have to add folder with header files and the library itself. You can do it with find_package, or manually.

The header files you have to include in "include_libraries" like I did:

include_directories(

include

include_directories( ${catkin_INCLUDE_DIRS} ${Qt5Core_INCLUDE_DIRS} ${Qt5WebSockets_INCLUDE_DIRS} /usr/include )

And the library itself, you can add with "target_link_libraries", like this:

add_executable(driver src/driver_node.cpp) target_link_libraries(driver ${catkin_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} /usr/lib/aarch64-linux-gnu/libserial.so)