Merge branch 'backport-fix-read-after-free' into release
Merge branch 'ninja-avoid-double-phony' into release
InstallRequiredSystemLibraries: Allow repeat use per-config

To be able to include InstallRequiredSystemLibraries more than once
(e.g. to get the Debug and Release libraries separately), clear the
internal library list for non-matching configuration.
Merge topic 'fix-valgrind-in-path'

58cc3c22 Fix ctest to allow valgrind to show up in the path name of a memcheck tool.
Help: Create proper identifiers for keywords in QtHelp.

This is necessary in order for the QHelpEngineCore::linksForIdentifier API
to work.

 http://doc-snapshot.qt-project.org/qt5-5.3/qhelpenginecore.html#linksForIdentifier

That API is used by QtCreator to enable contextual links to help files.
Help: Add context to titles in QtHelp.

This allows disambiguation of identifiers in Qt Assistant and Creator.
Encoding: Fix debug asserts parsing command line options with non-ascii chars.

With MSVC, isspace() will assert with non-ascii characters.
cmTarget: Remove unused GetInterfaceLinkLibraries method
cmTarget: De-duplicate library list expansion

Create an ExpandLinkItems method to handle evaluation of generator
expressions in a library list and expansion of the ;-list into a vector.
Replace some duplicate copies of the implementation with calls to the
new helper.
cmComputeTargetDepends: Remove unused 'linking' argument

The AddInterfaceDepends method is never called with a non-true value for
its 'linking' argument.  Drop it.
cmTarget: Simplify processILibs implementation

Combine the outer two if() conditions into a single one with &&.
Scope inner lookup result inside its condition.
cmComputeLinkDepends: Simplify CheckWrongConfigItem implementation

Combine the outer two if() conditions into a single one with &&.
cmTarget: Remove 'head' argument from GetTransitiveTargetClosure

The method is never called with any headTarget besides "this".
cmTarget: Rename Get{TransitiveTarget => LinkImplementation}Closure

The method computes the transitive closure of targets starting with
the current target link implementation libraries.  Clarify the name.
cmTarget: Cache GetLinkImplementationClosure results

Store them internally and return by reference to avoid duplicate
computation.
cmTarget: Remove 'head' argument from GetLinkInformation

No call sites use it anyway.

Co-Author: Stephen Kelly <steveire@gmail.com>
cmComputeLinkInformation: Remove 'head' argument

It is only ever constructed with the current target as its own 'head'.

Co-Author: Stephen Kelly <steveire@gmail.com>
cmTarget: Remove 'head' argument from GetLinkerLanguage

It is only ever called with the 'this' target as the head.

Co-Author: Stephen Kelly <steveire@gmail.com>
cmTarget: Drop 'head' argument from GetLinkClosure

It is only ever passed the 'this' target itself.
cmTarget: Remove 'head' argument from GetLinkImplementation

Many of the 'head' arguments added by commit v2.8.11~289^2~1 (Make
linking APIs aware of 'head' target, 2013-01-04) turned out not to be
needed.  The "link implementation" of a target never needs to be
computed with anything but itself as the 'head' target (except for
CMP0022 OLD behavior because then it is the link interface).

Remove the unused 'head' target paths.  Add "internal" versions of
cmTarget::GetDirectLinkLibraries and GetLinkImplementationLibraries
to support the CMP0022 OLD behavior without otherwise exposing the
'head' target option of these methods.