diff -urN jasper-version-3.0.3/CMakeLists.txt.orig jasper-version-3.0.3/CMakeLists.txt
--- jasper-version-3.0.3/CMakeLists.txt.orig	2022-06-10 16:41:10.983344800 +0200
+++ jasper-version-3.0.3/CMakeLists.txt	2022-06-10 16:42:23.433140800 +0200
@@ -723,10 +723,12 @@
 # Check for the Math library.
 ################################################################################
 
+if(NOT WIN32)
 find_library(MATH_LIBRARY m)
 if(NOT MATH_LIBRARY)
 	set(MATH_LIBRARY "")
 endif()
+endif()
 
 ################################################################################
 # Perform shared library setup.
diff -urN jasper-version-3.0.3/src/libjasper/CMakeLists.txt.orig jasper-version-3.0.3/src/libjasper/CMakeLists.txt
--- jasper-version-3.0.3/src/libjasper/CMakeLists.txt.orig	2022-06-10 16:46:29.634954300 +0200
+++ jasper-version-3.0.3/src/libjasper/CMakeLists.txt	2022-06-10 16:50:36.022617400 +0200
@@ -188,7 +188,7 @@
 	target_compile_definitions(libjasper PRIVATE _CRT_NONSTDC_NO_DEPRECATE)
 endif()
 
-if(UNIX)
+if(UNIX OR MINGW)
 	set_target_properties(libjasper PROPERTIES
 	  VERSION ${JAS_SO_NAME} SOVERSION ${JAS_SO_VERSION})
 endif()
