add_custom_command should raise a warning when used by more than one independent target
CMake document says this about add_custom_command:
Do not list the output in more than one independent target that may build in parallel or the two instances of the rule may conflict (instead use the add_custom_target() command to drive the command and make the other targets depend on that one).
However, when this happens, CMake gives not give any warning. This could cause random build error that is hard to be diagnosed.
CMake should:
- Give a warning when the output of add_custom_command is used by more than one independent target that my build in parallel, at least when all of those targets will be run by "make all"
- Add a policy to make the above warning a hard error