This is a case of an abstraction leaking across platforms. ExtractSharedLibraryName gains.lib via CMAKE_IMPORT_LIBRARY_SUFFIX because that is the suffix for linking to a shared library on Windows, via its import library. The is_shared_library code path is probably not needed on Windows, so additional conditions/heuristics could be added to avoid it.