cmTarget: Drop unused GetTransitiveTargetClosure argument

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 unused 'head' argument from several linking APIs

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.
cmComputeLinkDepends: Simplify CheckWrongConfigItem implementation

Combine the outer two if() conditions into a single one with &&.
cmTarget: Lookup targets in LinkInterface and LinkImplementation

Instead of storing just the string names in these structures, lookup any
target associated with each item and store its cmTarget pointer.  Use
the cmLinkItem class to hold the name and pointer together.  Update
client sites to use the pre-stored lookup result instead of looking up
the target name again.
cmTarget: Improve HaveBuildTreeRPATH implementation

Use GetLinkImplementationLibraries instead of GetDirectLinkLibraries
because it tells us whether there will be any libraries to link after
evaluating generator expressions.  Also GetDirectLinkLibraries will be
dropped soon.
cmTarget: Drop GetDirectLinkLibraries methods

Inline the implementation in the last remaining caller and drop the
methods.