--- ois-1.5/CMakeLists.txt.orig	2020-10-12 15:38:26.641550200 +0300
+++ ois-1.5/CMakeLists.txt	2020-10-12 15:41:33.725086800 +0300
@@ -159,10 +159,14 @@
         set(DIRECTX_ARCH x86)
     endif()
 
-    if (WINDOWSSDK_FOUND)
-        target_link_libraries(OIS "dinput8.lib" "dxguid.lib")
+    if (MSVC)
+        if (WINDOWSSDK_FOUND)
+            target_link_libraries(OIS "dinput8.lib" "dxguid.lib")
+        else()
+            target_link_libraries(OIS "${DXSDK_DIR}/Lib/${DIRECTX_ARCH}/dinput8.lib" "${DXSDK_DIR}/Lib/${DIRECTX_ARCH}/dxguid.lib")
+        endif()
     else()
-        target_link_libraries(OIS "${DXSDK_DIR}/Lib/${DIRECTX_ARCH}/dinput8.lib" "${DXSDK_DIR}/Lib/${DIRECTX_ARCH}/dxguid.lib")
+        target_link_libraries(OIS "-ldinput8" "-ldxguid" "-lxinput")
     endif()
 endif()
 
@@ -230,7 +234,7 @@
   install(FILES $<TARGET_PDB_FILE:OIS> DESTINATION bin OPTIONAL)
 endif(MSVC)
 
-if(UNIX)
+if(UNIX OR MINGW)
     configure_file(${CMAKE_CURRENT_SOURCE_DIR}/OIS.pc.in ${CMAKE_BINARY_DIR}/OIS.pc @ONLY)
     install(FILES ${CMAKE_BINARY_DIR}/OIS.pc DESTINATION ${OIS_LIB_DIRECTORY}/pkgconfig)
 endif()
