GetPrerequisites.cmake may not detect 'api-ms-win*' DLLs as being 'system' ones
As of CMake 3.6.1, function gp_resolved_file_type
in GetPrerequisites.cmake uses this regex to detect Windows' system DLLs:
if(lower MATCHES "^(api-ms-win-|${sysroot}/sys(tem|wow)|${windir}/sys(tem|wow)|(.*/)*msvc[^/]+dll)")
Unfortunately, the name resolution (from gp_resolve_item
, near the beginning of the function) may generate a full path, especially if the DLL is not found. It is the case for me with MS Visual 2015 new CRT ; I got something like C:/Development/MyProject/api-ms-win-core-misc-l1-1-0.dll
. I thus cannot INSTALL / PACKAGE my project as it considers this DLL as being non-system and thus is not ignored by the appropriate option.
I suggest then to generalize the regex (as for the "msvc*" DLLs):
if(lower MATCHES "^((.*/)*api-ms-win-[^/]+dll|${sysroot}/sys(tem|wow)|${windir}/sys(tem|wow)|(.*/)*msvc[^/]+dll)")
Here you'll find my modified GetPrerequisites.cmake file, against CMake 3.6.1.