Exporting targets having large FILE_SETs with install(EXPORT) or export(EXPORT)
currently performs poorly on Windows compared to Unix-like systems,
because cmFileSet::EvaluateDirectoryEntries calls SystemTools::SameFile on every
pair of parent directories in the file set. SystemTools::SameFile opens and closes
two read-only filesystem handles. This causes a significant performance drop
on Windows for FILE_SETs with even a couple of dozens of files.
Use the recently added SystemTools::GetFileId function in kwsys
(https://gitlab.kitware.com/utils/kwsys/-/merge_requests/298) instead of SameFile
to cache the identity of a directory in cmFileSet::EvaluateDirectoryEntries.
This means only one filesystem handle is needed per distinct directory path,
instead of two per (even if they're equal) directory pair.
We need to be able to construct BMIs that will be usable from the client
modules for the target importing the module, so create BMI-only
compilation rules for `IMPORTED` targets to create these BMIs.