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.

Split dependencies into lists of targets and non-targets and handle
the targets only as a special case.
Merge topic 'test-AUTOGEN-custom-command-depends' into next

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