--- mingw-w64-i686-opencolorio-1.0.9/CMakeLists.txt.orig	2013-12-27 22:36:16.348200000 +0400
+++ mingw-w64-i686-opencolorio-1.0.9/CMakeLists.txt	2013-12-27 22:43:09.892800000 +0400
@@ -37,7 +37,7 @@
 option(OCIO_PYGLUE_SONAME "If ON, soname/soversion will be set for Python module library" OFF)
 option(OCIO_PYGLUE_LIB_PREFIX "If ON, prefix the Python module with 'lib'" OFF)
 
-if(UNIX AND NOT APPLE)
+if(UNIX OR MINGW AND NOT APPLE)
     option(USE_EXTERNAL_YAML "Use system installed yaml-cpp library." OFF)
     option(USE_EXTERNAL_TINYXML "Use system installed tinyxml library." OFF)
     option(USE_EXTERNAL_LCMS "Use system install lcms2 library." OFF)
@@ -219,7 +219,11 @@
         ## => great news when build staticaly since we do not want another client project have to link also with tinyxml when he want to use this project
         ## => could be problematic if the client project use another version of tinyxml... In this case build tinyxml as shared lib with all projects could be a solution
         ## => TODO: so maybe provide a simple cmake way to build 3rdParty as shared and auto install with this project ?
-        set_target_properties(TINYXML_LIB PROPERTIES COMPILE_FLAGS "-DTIXML_USE_STL -fPIC -fvisibility-inlines-hidden -fvisibility=hidden")
+        if (MINGW)
+            set_target_properties(TINYXML_LIB PROPERTIES COMPILE_FLAGS "-DTIXML_USE_STL -fvisibility-inlines-hidden -fvisibility=hidden")
+        else()
+            set_target_properties(TINYXML_LIB PROPERTIES COMPILE_FLAGS "-DTIXML_USE_STL -fPIC -fvisibility-inlines-hidden -fvisibility=hidden")
+        endif()
         add_definitions(-DTIXML_USE_STL) ## needed to build correctly, and also need to be propagated in child projects (client projects)
         list(APPEND EXTERNAL_OBJECTS $<TARGET_OBJECTS:TINYXML_LIB>)
     else()
@@ -420,7 +424,7 @@
 messageonce("SSE Optimizations: ${OCIO_USE_SSE}")
 
 if(OCIO_USE_SSE)
-    if(WIN32)
+    if(MSVC)
         # SSE instructions are automatically compiled into 64-bit applications so enabling the option is redundant and
         # actually produces an unknown option warning in Visual Studio.
         if(NOT CMAKE_CL_64)
@@ -604,10 +604,16 @@
         set(OCIO_STATIC_COMPILE_DEFINITIONS )
     endif()
 endif()
-install(EXPORT OpenColorIO DESTINATION cmake)
+install(EXPORT OpenColorIO DESTINATION lib/cmake/OpenColorIO)
 file(WRITE "${CMAKE_BINARY_DIR}/OpenColorIOConfig.cmake"
     "
     get_filename_component(OpenColorIO_DIR \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)
+    get_filename_component(OpenColorIO_DIR \"\${OpenColorIO_DIR}\" PATH)
+    get_filename_component(OpenColorIO_DIR \"\${OpenColorIO_DIR}\" PATH)
+    get_filename_component(OpenColorIO_DIR \"\${OpenColorIO_DIR}\" PATH)
+    if(OpenColorIO_DIR STREQUAL \"/\")
+        set(OpenColorIO_DIR \"\")
+    endif()
     
     ## include
     set(OpenColorIO_INCLUDE_DIR     \"\${OpenColorIO_DIR}/include\")
@@ -612,7 +618,7 @@
     
     ## targets libraries + associated definitions
     if(NOT TARGET OpenColorIO)
-        include(\"\${OpenColorIO_DIR}/cmake/OpenColorIO.cmake\") ## thanks to imported target
+        include(\"\${OpenColorIO_DIR}/lib/cmake/OpenColorIO/OpenColorIO.cmake\") ## thanks to imported target
         if(TARGET OpenColorIO AND NOT OpenColorIO_USE_STATIC)
             message(STATUS \"shared target OpenColorIO : see OpenColorIO_LIBRARY\")
             set(OpenColorIO_LIBRARY         OpenColorIO)
@@ -650,4 +656,4 @@
     message(STATUS OPENCOLORIO_FOUND=\${OPENCOLORIO_FOUND})
     "
 )
-install(FILES "${CMAKE_BINARY_DIR}/OpenColorIOConfig.cmake" DESTINATION .)
+install(FILES "${CMAKE_BINARY_DIR}/OpenColorIOConfig.cmake" DESTINATION lib/cmake/OpenColorIO)
--- opencolorio/src/core/CMakeLists.txt.orig	2017-09-17 22:33:47.446262300 +0300
+++ opencolorio/src/core/CMakeLists.txt	2017-09-17 22:34:26.962522500 +0300
@@ -18,7 +18,7 @@
 
 # Process all warnings as errors
 
-if(WIN32)
+if(MSVC)
     # On debug mode there are other kinds of warning...
     if("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
         set(EXTERNAL_COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS} /WX")
@@ -75,7 +75,7 @@
         VERSION ${OCIO_VERSION}
         SOVERSION ${SOVERSION})
     
-    install(TARGETS OpenColorIO_STATIC EXPORT OpenColorIO ARCHIVE DESTINATION ${CMAKE_INSTALL_EXEC_PREFIX}/lib/static)
+    install(TARGETS OpenColorIO_STATIC EXPORT OpenColorIO ARCHIVE DESTINATION ${CMAKE_INSTALL_EXEC_PREFIX}/lib)
 endif()
 
 macro(target_link_OCIO target)
--- opencolorio-1.1.1/export/OpenColorIO/OpenColorIO.h.orig	2019-07-30 21:48:30.382243400 +0300
+++ opencolorio-1.1.1/export/OpenColorIO/OpenColorIO.h	2019-07-30 21:48:54.999086700 +0300
@@ -101,16 +101,16 @@
         
     private:
         //Add pragma warnings, STL member is private and not consumed by client of DLL
-        #ifdef _WIN32
+        #ifdef _MSC_VER
         #pragma warning(push)
         #pragma warning(disable:4251)
-        #endif // _WIN32
+        #endif // _MSC_VER
 
         std::string msg_;
 
-        #ifdef _WIN32
+        #ifdef _MSC_VER
         #pragma warning(pop)
-        #endif // _WIN32
+        #endif // _MSC_VER
     };
     
     //!cpp:class:: An exception class for errors detected at
--- opencolorio-1.1.1/src/core/OCIOYaml.cpp.orig	2019-07-30 21:52:19.319857900 +0300
+++ opencolorio-1.1.1/src/core/OCIOYaml.cpp	2019-07-30 21:52:21.613061900 +0300
@@ -67,14 +67,14 @@
 
 #endif
 
-#ifdef WIN32
+#ifdef _MSC_VER
 #pragma warning( push )
 #pragma warning( disable: 4146 )
 #endif
 
 #include <yaml-cpp/yaml.h>
 
-#ifdef WIN32
+#ifdef _MSC_VER
 #pragma warning( pop )
 #endif
 
