The win32 directory includes a vendored copy of keysmdef.h. This is a define-only header that is present on Unix systems but isn't installed with mingw. Since it is data-only, we can pull it from the native install, if we just make some tweaks to the CMake system to detect the version installed there. This will eliminate some vendored code, which is generally A Bad Thing (tm).