set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR i686)
set(TOOLCHAIN_PREFIX i686-w64-mingw32)

set(CMAKE_C_COMPILER   "${TOOLCHAIN_PREFIX}-gcc" CACHE STRING "C compiler" FORCE)
set(CMAKE_CXX_COMPILER "${TOOLCHAIN_PREFIX}-g++" CACHE STRING "C++ compiler" FORCE)
set(CMAKE_RC_COMPILER  "${TOOLCHAIN_PREFIX}-windres" CACHE STRING "rc compiler" FORCE)

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

set(WIN32 TRUE)
set(MINGW TRUE)
set(PLAT_HOOKS TRUE)

message( STATUS "MinGW 32-bit cross-compile toolchain invoked" )
