FindMPI: Use compiler implicit link dirs for matching language (#14870)

Update the logic added by commit 2f9ad7c6 (Fix FindMPI for the intel
compiler on linux, 2012-03-20) to use the implicit link directories for
the current ${lang} instead of hard-coding C or CXX which may not be
enabled.  This is necessary for Fortran-only projects.
CTestCustom: Suppress -Wcast-align warnings in sha2 code

This is third party code and we know that at run time the correct
alignment is achieved.
CompileFlags: add better selection which aCC version gets -AA +hpxstd98 flags
cmTarget: Fix listing of source files at configure-time.

Since commit e5da9e51 (cmTarget: Allow any generator expression in
SOURCES property., 2014-03-18), source files are computed by
true evaluation of generator expressions, including TARGET_OBJECTS.
This evaluation requires the presence of cmGeneratorTarget objects
since commit bf98cc25 (Genex: Evaluate TARGET_OBJECTS as a normal
expression., 2014-02-26).

Ensure that we don't attempt to evaluate the TARGET_OBJECTS generator
expression at configure-time, as can happen if CMP0024 or CMP0026
are OLD.  Use old-style parsing of the source item to extract
object target names in that case.

Avoid calling GetProperty("SOURCES") to bypass warnings from CMP0051.
Refactor existing logic in GetLanguages which is similar in intent to
the new GetSourceFiles code.
Help: Fix installation of the Qt qch file.

The file was changed to have the version in its name in
commit 111bb67c (Help: Use a more-appropriate qthelp namespace and
file name., 2014-04-10).
CMakeDetermineVSServicePack: Add deprecation diagnostic

Warn project developers at runtime that the module should not be used
anymore.  Issue the diagnostic only when the project requires a new
enough CMake to use the alternative.  Honor the
CMAKE_(ERROR|WARN)_DEPRECATED settings.
libarchive: Skip finding libacl.h when ENABLE_ACL is OFF (#14866)
Clean up usage of if(... MATCHES regex) followed string(REGEX REPLACE regex)

The matches have already been calculated and can simply be taken from
CMAKE_MATCH_n variables. This avoids multiple compilations of the same or very
similar regular expressions.
Replace string(REGEX REPLACE) with string(REPLACE) where possible

The simple replacement is much faster.
Remove .* expressions from beginning and end of MATCHES regexs

All these expressions work the same:
  "foo"
  ".*foo.*"
  "^.*foo.*$"

This assumes that the "Intel*" expressions were meant to be "Intel.*".
Use CMAKE_SYSTEM_NAME instead of CMAKE_SYSTEM where sufficient
Replace MATCHES ".+" tests with NOT STREQUAL ""
Replace MATCHES test on numbers with EQUAL test

The MATCHES tests were actually wrong, as "a4b" and "42" would also cause a
match when it should not.
Windows-GNU: Support duplicate object names in large archives (#14874)

Since commit v2.6.0~388 (Added build rule variables
CMAKE_<LANG>_ARCHIVE_..., 2008-01-29) we use separate "ar cr ..." and
"ar r ..." steps to incrementally add a large list of object files to an
archive.  Since the "r" command replaces existing objects of the same
name in an archive, if multiple objects have the same file name and
appear in separate append steps then one overwrites the other.  Instead,
use "ar cq ..." and "ar q ..." to always append to the archive.

We already remove the archive before creating it so this will not cause
objects to be appended to existing archives on incremental rebuilds.
cmELF: fix signedness warning on OpenBSD

OpenBSD defines Elf64_Dyn::d_tag to be of an unsigned type, which differs from
what most other platforms do and what is the case for 32 bit. To have the tag
as unsigned makes sense, but this causes a compilation warning:

/.../CMake/Source/cmELF.cxx: In member function 'const cmELF::StringEntry* cmELFInternalImpl<Types>::GetDynamicSectionString(int) [with Types = cmELFTypes64]':
/.../CMake/Source/cmELF.cxx:945:   instantiated from here
/.../CMake/Source/cmELF.cxx:668: warning: comparison between signed and unsigned integer expressions

Add an explicit typedef to cast the value to for 32 and 64 bit. That type is
unsigned and has the proper length for both platforms so no information is
lost. Explicitely cast both arguments before comparing them to avoid the
warning in all situations.
Help: Fix typo in CMP0051.

STRIP_GENEX -> GENEX_STRIP.
AIX: fix compilation error because of missing <sstream>

Replace it by cmStandardIncludes.h which drags in the proper header depending
on what the compiler provides to fix this error:

CMake/Source/cmExtraCodeLiteGenerator.cxx:27: sstream: No such file or directory
CTestCustom: Suppress warnings about rand() and srand() on OpenBSD

We don't do crypto here, so a "poor" random doesn't matter. In fact we have API
to allow people to get a repeatable sequence by setting a specific seed.
Ninja: replace \ in LINK_PATH for MinGW
MinGW: link like on Unix and use compile flags when linking