Check{C,CXX}CompilerFlag: Test using C locale (#14102)

Set the locale to C while running the compiler for these checks because
we match the resulting warning messages in English only.

Suggested-by: Marco Nolden <m.nolden@dkfz-heidelberg.de>
Only handle interface includes for valid target names.

As of CMake 2.8.11, generator expressions, including
configuration-specific expressions may be used as link libraries
of targets. The old-style keywords of target_link_libraries are
handled in terms of new generator expressions.

However, the generator expressions expect target names to be valid
against a regular expression, whereas target_link_libraries does
not require validation.

As this genex code is generated without any action from the user in
the next release, we need to ensure that only valid code is generated.

Ensure that strings which are not valid target names are not used
in generator expressions which validate the argument.

Commit 254687d3 (Only process transitive interface properties
for valid target names., 2013-03-06) introduced an ommission of a
link entry if it does validates as a target name when processing
interface include directories from dependent targets. That check is
now obsolete.
Ensure that empty strings are not passed to the genex TARGET_PROPERTY

Ensure that a link entry is a non-empty string before processing
includes from it.

Include directories are processed from the link interface of
dependent targets since commit a1c4905f (Use the link information
as a source of compile definitions and includes., 2013-02-12). That
commit included an optimization of skipping an entry from the link
interface if it is known not to be a target after evaluation as a
generator expression.

Commit 42ebb188 (Memoize includes and defines from interface
libraries., 2013-02-22) introduced caching of the includes. Part of
the problem is that the cache for the includes is not config
sensitive because the content can contain $<CONFIG> generator
expressions which will be evaluated anyway.

When generating the buildsystem with a multi-config generator,
the GetIncludeDirectories method happens to be called first with
the DEBUG configuration, followed by the others. So, in the
testcase:

 add_library(B SHARED a.c)
 target_link_libraries(B debug A)

the $<$<CONFIG:Debug>:A> is evaluated to 'A', and the generator
expression is cached. When the same genex is evaluated with
non-debug configurations, the evaluated result is the empty string,
which does not validate for the the TARGET_PROPERTY generator
expression.

If the 'debug' is replaced by 'optimized' in the testcase, the
bug does not occur. That is because the first call to
GetIncludeDirectories will evaluate $<NOT:$<CONFIG:Debug>:A>, get
an empty string (because config == Debug), and continue before
caching the result. The next call to GetIncludeDirectories will
be a non-empty string.
Merge topic 'fix-per-config-tll-include-dirs' into next

59ef6f3 Ensure that empty strings are not passed to the genex TARGET_PROPERTY
eff931b Only handle interface includes for valid target names.
Ensure that link dependent include directories are up to date.

If users set the LINK_LIBRARIES property directly, the interface
include directories from the entries they add should be processed.
Add special handling of the property to implement that.
Merge topic 'check-compiler-flag-locale' into next

5272372 Check{C,CXX}CompilerFlag: Test using C locale (#14102)
target_link_libraries: Update usage requirements documentation

Re-word the documentation to make clear that CMake integrates usage
requirements during generation and not synchronously during
configuration or execution of target_link_libraries.
Merge topic 'doc-tll-usage-requirements' into next

2618e02 target_link_libraries: Update usage requirements documentation
Merge topic 'fix-per-config-tll-include-dirs' into next

fbb76d0 Ensure that link dependent include directories are up to date.