I am running into an issue with the VIsual Studio 17 2022 generator and I am not sure if this is the intended behavior. I have a project configured with CMake that uses FetchContent to fetch it’s dependencies. In my CLion IDE, I get a list of targets that are available to run. This includes targets from the subprojects added with FetchContent. This is fine, but they are not necessary to build my project, so all of my FetchContent calls have EXCLUDE_FROM_ALL. All of this is the same when I use the Ninja generator. However, I ran into an issue that wasted an entire day of mine before I reread the EXCLUDE_FROM_ALL documentation. When using Ninja, I can still have CMake build an excluded target, cmake -B ./build/ -S . --target unnecessary. However, when I do the same with the Visual Studio generator, I get an opaque error message: MSBUILD : error MSB1009: Project file does not exist. Switch: unnecessary.vcxproj. This seems to be because the solution file just does not have any references to the excluded targets. It took an entire day of debugging before I figured out this was a byproduct of a specific interaction between EXCLUDE_FROM_ALL and the Visual Studio generator. From the command line, I can build that target using cmake -build ./build/_deps/subproject-build/ --target unnecessary, however in CLion, the unnecessary target just will not work because it builds the target from the project’s build directory. Is there a way to fix this behavior, or at least produce a better error message when using the Visual Studio generator?