Add a test to expose a bug with add_custom_command and ninja.

Ninja Generator is unable to handle an add_custom_command having
a dependency that is generated at build time by a previous target.
Ninja: GlobalNinjaGenerator WriteBuild and WritePhonyBuild non static

To properly track the usage of dependencies that are generated at
compile time as the side effect of other build steps we need
to make the WriteBuild and WritePhonyBuild commands non static
Ninja: Custom Command file depends don't need to exist before building

When converting custom commands for the ninja build system we
need to make sure that any file dependencies that exist in the build
tree are converted to phony targets. This tells ninja that these
files might not exist when starting the build, but could be generated
during the build.

This is done by tracking all dependencies for custom command targets.
After all have been written out we remove all items from the set
that have been seen as a; target, custom command output, an alias,
or a file in the source directory. Anything that is left is considered
to be a file that will be generated as a side effect of another
custom command.

Conflicts:
	Source/cmGlobalNinjaGenerator.cxx
Merge topic 'ninja_phony_targets' into next

bd2ce85 Ninja: Custom Command file depends don't need to exist before building
20d7ae7 Ninja: GlobalNinjaGenerator WriteBuild and WritePhonyBuild non static
88d27ad Add a test to expose a bug with add_custom_command and ninja.