QtAutogen: Fix AUTOGEN depends on custom command output with VS.

Visual Studio is handled as a special case for autogen depends. However,
the special handling works only for target dependencies, not file
dependencies output by a custom command.

Use a PRE_BUILD step only if all depends are targets.
Merge topic 'fix-AUTOGEN-custom-command-depends' into next

112cba92 QtAutogen: Fix AUTOGEN depends on custom command output with VS.