Use EXCLUDE_FROM_ALL to make targets optional in CMake Follow up from #1926 `set_target_properties(MyTarget PROPERTIES EXCLUDE_FROM_ALL TRUE)` Should also be done to other targets, like the IDE ones for thunks. #1923