Merge branch 'no-cmake-self-install-when-cross-compiling' into release
Merge branch 'vs-nsight-tegra-version' into release
Add USES_TERMINAL option for custom commands

Teach the add_custom_command and add_custom_target commands a new
USES_TERMINAL option.  Use it to tell the generator to give the command
direct access to the terminal if possible.
Give the interactive cache editor the USES_TERMINAL property
Ninja: factor out the test for console pool support
Ninja: Remove unused declaration
Ninja: Implement USES_TERMINAL using the console pool if available
Help: Add notes for topic 'console-pool'
Tests/BuildDepends: Drop unneeded help for Ninja

The extra post-modification invocations of 'ninja' does not seem to be
needed anymore for the BuildDepends test to pass.
Ninja: Use a TARGET_FILE variable to hold the link output file

Use an explicit "$TARGET_FILE" variable instead of "$out" so that
we can have multiple output files while still only referencing the
main one in command lines.
Ninja: Refactor restat to be a string internally

This will allow values other than "" and "1" to be generated in
the rules.ninja file.
Add an option for explicit BYPRODUCTS of custom commands (#14963)

A common idiom in CMake-based build systems is to have custom commands
that generate files not listed explicitly as outputs so that these
files do not have to be newer than the inputs.  The file modification
times of such "byproducts" are updated only when their content changes.
Then other build rules can depend on the byproducts explicitly so that
their dependents rebuild when the content of the original byproducts
really does change.

This "undeclared byproduct" approach is necessary for Makefile, VS, and
Xcode build tools because if a byproduct were listed as an output of a
rule then the rule would always rerun when the input is newer than the
byproduct but the byproduct may never be updated.

Ninja solves this problem by offering a 'restat' feature to check
whether an output was really modified after running a rule and tracking
the fact that it is up to date separately from its timestamp.  However,
Ninja also stats all dependencies up front and will only restat files
that are listed as outputs of rules with the 'restat' option enabled.
Therefore an undeclared byproduct that does not exist at the start of
the build will be considered missing and the build will fail even if
other dependencies would cause the byproduct to be available before its
dependents build.

CMake works around this limitation by adding 'phony' build rules for
custom command dependencies in the build tree that do not have any
explicit specification of what produces them.  This is not optimal
because it prevents Ninja from reporting an error when an input to a
rule really is missing.  A better approach is to allow projects to
explicitly specify the byproducts of their custom commands so that no
phony rules are needed for them.  In order to work with the non-Ninja
generators, the byproducts must be known separately from the outputs.

Add a new "BYPRODUCTS" option to the add_custom_command and
add_custom_target commands to specify byproducts explicitly.  Teach the
Ninja generator to specify byproducts as outputs of the custom commands.
In the case of POST_BUILD, PRE_LINK, and PRE_BUILD events on targets
that link, the byproducts must be specified as outputs of the link rule
that runs the commands.  Activate 'restat' for such rules so that Ninja
knows it needs to check the byproducts, but not for link rules that have
no byproducts.
ExternalProject: Add options to specify BYPRODUCTS (#14963)

The external project's build process may generate byproducts on which
other rules in the driving project's build later depend.  Provide a way
for the driving project to specify what byproducts it expects to be made
available by the custom commands that drive the external project.
KWSys SharedForward: Hard-code the ldpath buffer size to below VS 14 limit

Visual Studio 14 (2015) complains if a static character array is
declared with more than 65535 elements.  This limit should be large
enough for SharedForward clients, so just hard-code that instead of
trying to compute a limit.
Merge topic 'custom-command-byproducts' into next

120acb13 ExternalProject: Add options to specify BYPRODUCTS (#14963)
85a80518 Add an option for explicit BYPRODUCTS of custom commands (#14963)
dbe4e890 Ninja: Refactor restat to be a string internally
b1dc6909 Ninja: Use a TARGET_FILE variable to hold the link output file
be238777 Tests/BuildDepends: Drop unneeded help for Ninja
VS: Rename VS 14 generator to 'Visual Studio 14 2015'

Now that we know the year component of this VS version we
can add it to the generator name.  For convenience, map
the name without the year to the name with the year.
Merge topic 'vs14-is-2015' into next

f5afb90d VS: Rename VS 14 generator to 'Visual Studio 14 2015'
Merge branch 'release'
Merge branch 'master' into next
Tests/BuildDepends: Drop unneeded help for Ninja

The extra post-modification invocations of 'ninja' does not seem to be
needed anymore for the BuildDepends test to pass.