diff -Naur blender-4.5.2/CMakeLists.txt blender-4.5.2-patched/CMakeLists.txt
--- blender-4.5.2/CMakeLists.txt	2025-07-10 12:34:49.000000000 +0300
+++ blender-4.5.2-patched/CMakeLists.txt	2025-08-26 12:19:19.719349400 +0300
@@ -420,7 +420,7 @@
   option(WITH_X11_XFIXES "Enable X11 XWayland cursor warping workaround" ON)
 endif()
 
-if(UNIX AND NOT APPLE)
+if((UNIX AND NOT APPLE) OR MINGW)
   option(WITH_SYSTEM_FREETYPE "Use the freetype library provided by the operating system" OFF)
   option(WITH_SYSTEM_EIGEN3 "Use the systems Eigen3 library" OFF)
 else()
@@ -521,7 +521,7 @@
 # Compression
 option(WITH_LZO "Enable fast LZO compression (used for pointcache)" ON)
 option(WITH_LZMA "Enable best LZMA compression, (used for pointcache)" ON)
-if(UNIX AND NOT APPLE)
+if((UNIX AND NOT APPLE) OR MINGW)
   option(WITH_SYSTEM_LZO "Use the system LZO library" OFF)
 endif()
 option(WITH_DRACO "Enable Draco mesh compression Python module (used for glTF)" ON)
@@ -541,7 +541,7 @@
 option(WITH_FREESTYLE "Enable Freestyle (advanced edges rendering)" ON)
 
 # Libraries.
-if(UNIX AND NOT APPLE)
+if((UNIX AND NOT APPLE) OR MINGW)
   # Optionally build without pre-compiled libraries.
   # NOTE: this could be supported on all platforms however in practice UNIX is the only platform
   # that has good support for detecting installed libraries.
@@ -569,7 +569,7 @@
 option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ON)
 # On Windows and for the Blender application on macOS, portable install
 # is the only supported installation type, so there is no option.
-if(UNIX AND (NOT APPLE OR WITH_PYTHON_MODULE))
+if((UNIX AND (NOT APPLE OR WITH_PYTHON_MODULE)) OR MINGW)
   option(WITH_INSTALL_PORTABLE "\
 Install redistributable runtime, otherwise install into CMAKE_INSTALL_PREFIX"
     ON
@@ -916,7 +916,7 @@
 
 
 # Documentation
-if(UNIX AND NOT APPLE)
+if((UNIX AND NOT APPLE) OR MINGW)
   option(WITH_DOC_MANPAGE "Create a manual page (Unix manpage)" OFF)
 endif()
 
@@ -984,7 +984,7 @@
   set(WITH_METAL_BACKEND OFF)
 endif()
 
-if(WIN32)
+if(MSVC)
   getDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES)
   set(CPACK_INSTALL_PREFIX ${CMAKE_GENERIC_PROGRAM_FILES}/${})
 endif()
@@ -1161,7 +1161,7 @@
   mark_as_advanced(WITH_COMPILER_SHORT_FILE_MACRO)
 endif()
 
-if(WIN32)
+if(MSVC)
   # Use hardcoded paths or find_package to find externals
   option(WITH_WINDOWS_FIND_MODULES "Use find_package to locate libraries" OFF)
   mark_as_advanced(WITH_WINDOWS_FIND_MODULES)
@@ -1574,8 +1574,10 @@
 
 if(UNIX AND NOT APPLE)
   include(platform_unix)
-elseif(WIN32)
+elseif(MSVC)
   include(platform_win32)
+elseif(MINGW)
+  include(platform_win32_mingw64)
 elseif(APPLE)
   include(platform_apple)
 endif()
@@ -1661,7 +1663,7 @@
 endif()
 if(WITH_IMAGE_OPENJPEG)
   # Special handling of Windows platform where openjpeg is always static.
-  if(WIN32)
+  if(WIN32 AND WITH_STATIC_LIBS)
     set(OPENJPEG_DEFINES "-DOPJ_STATIC")
   else()
     set(OPENJPEG_DEFINES "")
@@ -2544,7 +2546,7 @@
     )
   endif()
 
-  if(WIN32)
+  if(MSVC)
     # Always use numpy bundled in precompiled libs.
   elseif((WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY) OR WITH_PYTHON_NUMPY)
     if(("${PYTHON_NUMPY_PATH}" STREQUAL "") OR (${PYTHON_NUMPY_PATH} MATCHES NOTFOUND))
@@ -2557,13 +2559,13 @@
     endif()
   endif()
 
-  if(WIN32 OR APPLE)
+  if(MSVC OR APPLE)
     # Always copy from precompiled libs.
   elseif(WITH_PYTHON_INSTALL_REQUESTS)
     find_python_package(requests "")
   endif()
 
-  if(WIN32 OR APPLE)
+  if(MSVC OR APPLE)
     # Always copy from precompiled libs.
   elseif(WITH_PYTHON_INSTALL_ZSTANDARD)
     find_python_package(zstandard "")
diff -Naur blender-4.5.2/build_files/cmake/Modules/FindOpenImageIO.cmake blender-4.5.2-patched/build_files/cmake/Modules/FindOpenImageIO.cmake
--- blender-4.5.2/build_files/cmake/Modules/FindOpenImageIO.cmake	2025-07-10 12:33:55.000000000 +0300
+++ blender-4.5.2-patched/build_files/cmake/Modules/FindOpenImageIO.cmake	2025-08-26 12:19:19.724860600 +0300
@@ -54,6 +54,7 @@
 find_file(OPENIMAGEIO_TOOL
   NAMES
     oiiotool
+    oiiotool.exe
   HINTS
     ${_openimageio_SEARCH_DIRS}
   PATH_SUFFIXES
diff -Naur blender-4.5.2/build_files/cmake/Modules/FindPythonLibsUnix.cmake blender-4.5.2-patched/build_files/cmake/Modules/FindPythonLibsUnix.cmake
--- blender-4.5.2/build_files/cmake/Modules/FindPythonLibsUnix.cmake	2025-07-10 12:33:55.000000000 +0300
+++ blender-4.5.2-patched/build_files/cmake/Modules/FindPythonLibsUnix.cmake	2025-08-26 12:19:19.729861600 +0300
@@ -50,7 +50,9 @@
   endif()
 else()
   # See: http://docs.python.org/extending/embedding.html#linking-requirements
-  set(PYTHON_LINKFLAGS "-Xlinker -export-dynamic" CACHE STRING "Linker flags for python")
+  if(NOT MINGW)
+    set(PYTHON_LINKFLAGS "-Xlinker -export-dynamic" CACHE STRING "Linker flags for python")
+  endif()
   mark_as_advanced(PYTHON_LINKFLAGS)
 endif()
 
diff -Naur blender-4.5.2/build_files/cmake/macros.cmake blender-4.5.2-patched/build_files/cmake/macros.cmake
--- blender-4.5.2/build_files/cmake/macros.cmake	2025-07-10 12:33:55.000000000 +0300
+++ blender-4.5.2-patched/build_files/cmake/macros.cmake	2025-08-26 12:19:19.735894000 +0300
@@ -1517,7 +1517,7 @@
 
 macro(optimize_debug_target executable)
   if(WITH_OPTIMIZED_BUILD_TOOLS)
-    if(WIN32)
+    if(MSVC)
       remove_cc_flag(${executable} "/Od" "/RTC1")
       target_compile_options(${executable} PRIVATE "/Ox")
       target_compile_definitions(${executable} PRIVATE "_ITERATOR_DEBUG_LEVEL=0")
diff -Naur blender-4.5.2/intern/cycles/app/CMakeLists.txt blender-4.5.2-patched/intern/cycles/app/CMakeLists.txt
--- blender-4.5.2/intern/cycles/app/CMakeLists.txt	2025-07-10 12:33:56.000000000 +0300
+++ blender-4.5.2-patched/intern/cycles/app/CMakeLists.txt	2025-08-26 12:19:19.740859500 +0300
@@ -140,7 +140,7 @@
 
   install(
     TARGETS cycles
-    DESTINATION ${CMAKE_INSTALL_PREFIX})
+    DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
 
   add_test(
     NAME cycles_version
diff -Naur blender-4.5.2/source/blender/blentranslation/msgfmt/CMakeLists.txt blender-4.5.2-patched/source/blender/blentranslation/msgfmt/CMakeLists.txt
--- blender-4.5.2/source/blender/blentranslation/msgfmt/CMakeLists.txt	2025-07-10 12:33:56.000000000 +0300
+++ blender-4.5.2-patched/source/blender/blentranslation/msgfmt/CMakeLists.txt	2025-08-26 12:19:19.744859700 +0300
@@ -26,7 +26,9 @@
 add_cc_flags_custom_test(msgfmt)
 
 if(WIN32)
+  if(MSVC)
   string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG " /nodefaultlib:MSVCRT.lib")
+  endif()
   list(APPEND LIB bf_intern_utfconv)
 endif()
 
diff -Naur blender-4.5.2/source/creator/CMakeLists.txt blender-4.5.2-patched/source/creator/CMakeLists.txt
--- blender-4.5.2/source/creator/CMakeLists.txt	2025-07-31 04:30:13.000000000 +0300
+++ blender-4.5.2-patched/source/creator/CMakeLists.txt	2025-08-26 12:19:19.750859500 +0300
@@ -375,7 +375,7 @@
 #
 # Setup version directory, libraries, `bpy` & text files.
 
-if(UNIX AND NOT APPLE)
+if((UNIX AND NOT APPLE) OR MINGW)
   if(WITH_PYTHON_MODULE)
     if(WITH_INSTALL_PORTABLE)
       set(TARGETDIR_BPY "bpy")
@@ -548,7 +548,7 @@
     DESTINATION ${TARGETDIR_VER}/datafiles
   )
 endif()
-if(WIN32)
+if(MSVC)
   if(EXISTS ${LIBDIR}/osl/lib/python${PYTHON_VERSION}/site-packages/oslquery) # 4.4+
     install(
       DIRECTORY ${LIBDIR}/osl/lib/python${PYTHON_VERSION}/site-packages/oslquery
@@ -691,7 +691,7 @@
 # -----------------------------------------------------------------------------
 # Install Targets (Platform Specific)
 
-if(UNIX AND NOT APPLE)
+if((UNIX AND NOT APPLE) OR MINGW)
 
   if(PLATFORM_BUNDLED_LIBRARIES AND TARGETDIR_LIB)
     install(
@@ -2026,13 +2026,17 @@
   install(
     TARGETS blender blender-launcher
     COMPONENT Blender
-    DESTINATION "."
+    RUNTIME DESTINATION bin
+    ARCHIVE DESTINATION lib
+    LIBRARY DESTINATION lib
   )
   if(WITH_CPU_CHECK)
     install(
       TARGETS blender_cpu_check
       COMPONENT Blender
-      DESTINATION "."
+      RUNTIME DESTINATION bin
+      ARCHIVE DESTINATION lib
+      LIBRARY DESTINATION lib
     )
   endif()
   set_target_properties(
@@ -2054,7 +2058,7 @@
 # As executing Blender is needed - it's important this operation runs after the shared
 # libraries have been installed to their destination.
 
-if(UNIX AND NOT APPLE)
+if((UNIX AND NOT APPLE) OR MINGW)
   if(NOT WITH_PYTHON_MODULE)
     if(WITH_DOC_MANPAGE)
       # Only run the command to generate the man-page when it may be outdated.
diff -Naur blender-4.5.2/build_files/cmake/platform/dependency_targets.cmake blender-4.5.2-patched/build_files/cmake/platform/dependency_targets.cmake
--- blender-4.5.2/build_files/cmake/platform/dependency_targets.cmake	2025-08-26 12:35:30.411631000 +0300
+++ blender-4.5.2-patched/build_files/cmake/platform/dependency_targets.cmake	2025-08-26 18:54:50.150223300 +0300
@@ -26,7 +26,7 @@
 add_library(bf_deps_optional_manifold INTERFACE)
 add_library(bf::dependencies::optional::manifold ALIAS bf_deps_optional_manifold)
 if(WITH_MANIFOLD)
-  if(WIN32)
+  if(MSVC)
     target_compile_definitions(bf_deps_optional_manifold INTERFACE WITH_MANIFOLD)
     target_include_directories(bf_deps_optional_manifold SYSTEM INTERFACE ${MANIFOLD_INCLUDE_DIRS})
     target_link_libraries(bf_deps_optional_manifold INTERFACE ${MANIFOLD_LIBRARIES} bf::dependencies::optional::tbb)
