Excluding external subprojects from being added to run configurations...


I've recently starting using cmake's FetchContent system to add external projects to my CLion project. This largely automates the process of ‘importing’ an external project in a git repository into your own project.

It mostly works, except that CLion adds all subprojects from the external projects to my list of 'Run Configurations', making it hard to find my own actual projects, as there's a lot of external subprojects but only a few of mine!

There's an EXCLUDE_FROM_ALL option to FetchContent_Declare  which I think is supposed to  prevent this happening, but it doesn't seem to do anything. EXCLUDE_FROM_ALL doesn't seem to do anything in add_subdirectory either.

Also, semi-related, but is there any way to prevent CLion auto-detecting .git folders in subprojects as VCS roots?

Subprojects from FetchContent are actually stored in cmake-build-blah dirs, and I've already got a .gitignore pattern for these so I was a bit surprised that they showed up at all.




Please sign in to leave a comment.