You are misunderstanding what EXCLUDE_FROM_ALL does. The dependency is still added to the build, and the same targets are all still defined. When EXCLUDE_FROM_ALL is given, all it means is don’t build the dependency’s targets as part of the default ALL target. They are still defined and can be manually built, hence why they still show up in your IDE.
@craig.scott ah, I see I’m mistaken now. Thanks for the reply. Do you happen to know if there is a way to include a project with fetch content without having its targets added to an IDE project?
Not that I’m aware of. CMake doesn’t have any mechanism to say “treat this target as internal, don’t show it in IDEs”. Some related discussion can be found in this feature request.