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.
cmTarget: Remove unused GetInterfaceLinkLibraries method
cmExportFileGenerator: Make SetImportLinkProperty a template

Allow the vector of property entries to have any element type
that can convert to std::string.
cmTarget: Add method to lookup other targets in a target's scope

Move the main implementation of cmComputeLinkDepends::FindTargetToLink
into cmTarget.
cmComputeTargetDepends: Remove unused 'linking' argument

The AddInterfaceDepends method is never called with a non-true value for
its 'linking' argument.  Drop it.
cmTarget: Constify GetTransitivePropertyTargets results

Populate a vector of "cmTarget const*" instead of "cmTarget*".
cmTarget: Constify GetLinkImplementationClosure results

Populate a vector of "cmTarget const*" instead of "cmTarget*".
Fix scope of transitive target name lookups

In cmTarget, cmGeneratorTarget, and cmGeneratorExpressionEvaluator, fix
target name lookups to occur in the cmMakefile context of the target
that referenced the name, not the current 'head' target.  The context
matters for imported targets because they are directory-scoped instead
of globally unique.  We already do this in cmComputeLinkDepends and
cmComputeTargetDepends.

Extend the InterfaceLibrary test with an example covering this behavior.
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.
cmTarget: Drop 'head' target from GetImportInfo

Move generator expression evaluation for imported library lists out of
GetImportInfo and into a new GetImportLinkInterface helper.  This avoids
duplicating the computation and storage of all imported target info just
because some of it is parameterized on the 'head' target.
cmTarget: Add cmLinkItem to refer to a target by name and pointer

Many items named in target_link_libraries calls are targets, but not
all.  Create a cmLinkItem type that acts like std::string so it can name
an item but also has a pointer to a cmTarget that is the result of
looking up the item name in the referencing target's scope.  This will
be useful to avoid duplicate lookup operations later.
cmTarget: Add GetUtilityItems to get target ordering dependencies

Add a method like GetUtilities but that provides the target names
already looked up and resolved to cmTarget pointers internally.  Update
call site in cmComputeTargetDepends::AddInterfaceDepends to use the
already-found target instead of looking it up again.
cmTarget: Simplify processILibs implementation

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