For the Windows GNU platform, CMAKE_FIND_LIBRARY_PREFIXES is a list containing an empty string, which ended up in a regex capturing group, which is invalid in CMake's regex engine. With this change, we get the following:
set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "") set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".a" ".lib") get_system_libname(path/to/libz.dll.a zlib) message("${zlib}")
outputs z, as expected.