if(${MINGW})
	if(NOT DEFINED MINGW_DIR)
		get_filename_component(MINGW_BIN ${CMAKE_CXX_COMPILER} PATH)
		get_filename_component(MINGW_DIR ${MINGW_BIN} PATH)
		find_path(MINGW_INCLUDE
			windows.h
		PATHS
			ENV INCLUDE
			${MINGW_DIR}
			${MINGW_DIR}/i686-w64-mingw32
			${MINGW_DIR}/x86_64-w64-mingw32
		PATH_SUFFIXES
			include)
		#message(STATUS "Find MinGW  = ${MINGW_INCLUDE}")
		#if(NOT ${MINGW_INCLUDE}) MINGW_INCLUDE = ${MINGW_DIR}/include
		find_library(MINGW_LIB m HINTS ${MINGW_BIN}/../lib ${MINGW_INCLUDE}/../lib)
		get_filename_component(MINGW_LIB ${MINGW_LIB} PATH)
		if (NOT _MGW_MSG)
			set(_MGW_MSG 1 CACHE BOOL "msg_mingw" FORCE)
			message(STATUS "Found MinGW binary path = ${MINGW_BIN}")
			message(STATUS "Found MinGW include path = ${MINGW_INCLUDE}")
			message(STATUS "Found MinGW library path = ${MINGW_LIB}")
		endif()
	endif()
endif(${MINGW})
