I have a ROS project that I had set up totally fine in Clion. Something in my settings got reset and now I'm getting `This file does not belong to any project target, code insight features might not work properly`.
The project dir looks roughly like this:
│ └── genicam.launch
I've added the env variables to Cmake Settings:
The CMakeLists.txt has all the usual Catkin boilerplate, e.g.:
find_package(catkin REQUIRED COMPONENTS
And I have the executable as a target:
And it compiles! I see the target in Run -> Edit Configurations ( "driver_node" ) and it compiles with no complaints. But I still get the yellow banner. Furthermore I can click on `src/driver.cpp` in CmakeLists, hit Ctrl-B, and jump right to that file. So clearly it has some awareness that file is part of the project.
I've tried various combinations of rm-ing .idea, cmake caches, File->Invalidate Caches, to no avail.
Actually, instead of talking in the abstract, here is an example right out of the box. If you go into `prosilica_nodelet.cpp`, jump to
and jump to that file, you get the Yellow Banner of Doom, and accordingly, macros like NODELET_WARN from that include file get the red squiggle. Even though `/opt/ros/melodic/include` is in `target_include_directories`.