file(GET_RUNTIME_DEPENDENCIES): Preserve casing for Windows PE binaries
For Windows PE files the file(GET_RUNTIME_DEPENDENCIES)
command
converts the name of all DLLs found during binary scanning to
lowercase in order to simplify the syntax requirements of its regex
filters; however, this has the side-effect of causing all DLL paths
returned via RESOLVED_DEPENDENCIES_VAR to be in lowercase, regardless
of their actual casing.
Instead, respect the original casing as closely as possible when returning resolved dependencies after all filters have been passed:
When evaluating a Windows PE format binary on a non-Windows host the casing of dependencies recorded within the binary are used. When the host is running Windows, the actual casing of the dependencies on-disk are used instead.
Fixes: #23091 (closed)
Topic-rename: file-GET_RUNTIME_DEPENDENCIES-windows-casing