set(CMAKE_SYSTEM_NAME Windows)

set(COMPILER_PREFIX x86_64-w64-mingw32-)
set(CMAKE_C_COMPILER ${COMPILER_PREFIX}gcc)
set(CMAKE_CXX_COMPILER ${COMPILER_PREFIX}c++)
set(CMAKE_RC_COMPILER ${COMPILER_PREFIX}windres)
set(CMAKE_PKGCONFIG_EXECUTABLE ${COMPILER_PREFIX}pkg-config)
set(PKG_CONFIG_EXECUTABLE ${COMPILER_PREFIX}pkg-config)
set(CMAKE_SYSTEM_PROCESSOR x86)

if (APPLE)
	set(TARGET_ENVIRONMENT /usr/local/mingw-w32-bin_i686-darwin/i686-w64-mingw32)
else()
	set(TARGET_ENVIRONMENT /usr/x86_64-w64-mingw32/sys-root/mingw/)
endif(APPLE)

# here is the target environment located
set(CMAKE_FIND_ROOT_PATH ${TARGET_ENVIRONMENT})

# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
