How to use ROS without a Catkin workspace

To use ROS inside a GUI so that you don’t need to source the setup.bash:

SET(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH} /home/robot/YOUR_CATKIN_WORKSPACE/install")

Then add:

find_package( roscpp )
${roscpp_INCLUDE_DIRS}
${roscpp_LIBRARIES}

Bookmark the permalink.