When a particular target, e.g. "target1" is explicitly selected for the build step, and this target is removed from the CMake project, it remains active for this build step, but is not listed in the available targets and cannot be removed. When building, this leads to an error.
- Add add_custom_target(target1) to a CMake project.
- Select this target for the build step.
- Change the target name to target2 in the CMake project.
- Try to build (error) or to change the build targets (target1 not removable).