if (${MINGW})
if (NOT DEFINED MINGW_DIR)
	get_filename_component(MINGW_BIN ${CMAKE_C_COMPILER} PATH)
	get_filename_component(MINGW_DIR ${MINGW_BIN} PATH)
	find_path(MINGW_INCLUDE windows.h HINTS ${MINGW_DIR}/include)
	find_library(MINGW_LIB m HINTS ${MINGW_BIN}/../lib ${MINGW_INCLUDE}/../lib)
	get_filename_component(MINGW_LIB ${MINGW_LIB} PATH)
	message(STATUS "Find MinGW binary path = ${MINGW_BIN}")
	message(STATUS "Find MinGW include path = ${MINGW_INCLUDE}")
	message(STATUS "Find MinGW library path = ${MINGW_LIB}")
endif ()
endif (${MINGW})
