diff --git a/CMakeLists.txt b/CMakeLists.txt
index d2ef3c9f..7b73c0ae 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1428,7 +1428,7 @@ foreach(ZLIB_INSTALL_LIBRARY ${ZLIB_INSTALL_LIBRARIES})
         "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
 endforeach()
 
-if(WIN32)
+if(WIN32 AND NOT MINGW)
     # Shared library
     if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)
         set_target_properties(zlib-ng PROPERTIES OUTPUT_NAME zlib${SUFFIX})
@@ -1456,6 +1456,9 @@ if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)
     set_target_properties(zlib-ng PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
 
     if(ZLIB_COMPAT)
+        set_target_properties(zlib-ng PROPERTIES OUTPUT_NAME "zlib")
+        set_target_properties(zlib-ng PROPERTIES PREFIX "")
+        set_target_properties(zlib-ng PROPERTIES ARCHIVE_OUTPUT_NAME "z")
         set_target_properties(zlib-ng PROPERTIES SOVERSION 1)
     else()
         set_target_properties(zlib-ng PROPERTIES SOVERSION 2)
