cmake: Future-proof --find-package mode.

Create cmGeneratorTargets before generating generate-time information.
C++ interfaces for querying build information is increasingly only
available at generate time through the cmGeneratorTarget class.  Ensure
that the required cmGeneratorTarget instances are created.  Use the
cmGlobalGenerator access API to access the relevant cmGeneratorTarget
instead of creating a temporary one on the stack.
Ninja: Avoid re-running CMake on next build after regeneration

In commit 4a6397a7 (Ninja: Track configured files so we can regenerate
them, 2013-06-17) we accidentally started listing files generated by
CMake as inputs to the configuration process instead of outputs from it.
Move the list of files generated by CMake to the regeneration rule
outputs section and tell Ninja to restat after running it.
Merge topic 'ninja_fix_rerun' into next

6fac24d7 Ninja: Avoid re-running CMake on next build after regeneration
Merge topic 'fix-find-package-mode' into next

a7f393dc cmake: Future-proof --find-package mode.