cmake: Fix read-after-free while checking command-line arguments

Since commit v2.8.12~300^2~1 (CLI: Suppress the unused warning if the
key value pair is cached, 2013-05-16), cmake::SetCacheArgs saves a
cachedValue pointer and may cause the memory to be freed (by setting the
cache entry) before reading it again.  Fix this by saving the old value
in a separate string.
Merge branch 'backport-fix-read-after-free' into release
Ninja: Remove CMake includes from explicit depends (#14972)

It may happen that CMake include is an explicit dependency for some command,
while all CMake includes are set phony in WriteTargetRebuildManifest, this may
lead to duplicate phony generate rules which causes ninja warnings.

We need to remove implicit CMake includes in WriteUnknownExplicitDependencies.

This fixes FindCUDA ninja warnings.
Merge branch 'ninja-avoid-double-phony' into release
Fortran: Add support for GNU >= 4.9 compressed modules (#14975)

From the GCC 4.9 release notes for Fortran:

 https://gcc.gnu.org/gcc-4.9/changes.html
 "Module files: The version of the module files (.mod) has been
  incremented; additionally, module files are now compressed."

Teach cmDependsFortran::ModulesDiffer to look for the gzip magic numbers
at the beginning of the module file.  If found, assume the module was
produced by gfortran >= 4.9.  The modules do not appear to contain the
date as earlier versions did so we can compare the content directly
and do not actually need to decompress.
Merge branch 'gfortran-compressed-modules' into release