[Discourse.ros.org] [Next Generation ROS] ROS2 + Clion

In ROS2 you can not have (yet?) your full workspace being imported in your IDE. However what you can have is individual packages and an environment for all dependencies. Say for e.g. rclcpp this what you do to get it imported into Clion:

b) Second you need to prepare you top level CMakeLists.txt file:
- cd ros_ws
- find src -name CMakeLists.txt -not -name setup.py -print0 | xargs -0 -n1 dirname | sort --unique
- after I manually removed all fastRTPS subfolders and test subfolders
- I also skipped all ament_* folders
- I used emacs to replace ./ with add_subdirectory and to add ) at the end of every line (replace-string, C-q C-j)

c) Put this CMakeLists.txt into your ros_ws.

d) Comment out the following line in ament_cmake_core/ament_cmake_uninstall_target-extras.cmake: