Automatically create a scope based on CMake target

I have a repo/project with a layout like so:

├── board_a
│   └── CMakeLists.txt
├── board_b
│   └── CMakeLists.txt
├── board_c
│   └── CMakeLists.txt
├── board_d
│   └── CMakeLists.txt
├── CMakeLists.txt
└── shared_code

where the CMake call to `project()` is in the top-level CmakeLists.txt. A developer would only be working on one of the boards at a time. For instance, if working on board_a, the developer is only concerned with building the target `board_a` and  ehen using CLion's refactoring and searching features, I only want it to look through files associated with the `board_a` target. I can accomplish this by manually creating a scope for each `board_*` target, but it would be nice if there were a way to tell CLion to automatically set its scope to some target. I think there should be all the information required via CMake to make this possible.

Let me know if this can already be accomplished or if it seems reasonable to implement.

Thank you!



Please sign in to leave a comment.