set(MINGW_TOOLCHAIN @MINGW_TOOLCHAIN@) set(CMAKE_SYSTEM_NAME Windows) set(CMAKE_CROSSCOMPILING ON) set(CMAKE_AR "${MINGW_TOOLCHAIN}-ar") set(CMAKE_C_COMPILER "${MINGW_TOOLCHAIN}-gcc") set(CMAKE_CXX_COMPILER "${MINGW_TOOLCHAIN}-g++") set(CMAKE_RC_COMPILER "${MINGW_TOOLCHAIN}-windres") set(CMAKE_OBJCOPY "${MINGW_TOOLCHAIN}-objcopy") set(CMAKE_OBJDUMP "${MINGW_TOOLCHAIN}-objdump") set(CMAKE_READELF "${MINGW_TOOLCHAIN}-readelf") set(CMAKE_FIND_ROOT_PATH "/usr/${MINGW_TOOLCHAIN}") set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) find_program(WINE wine) if(WINE) set(CMAKE_CROSSCOMPILING_EMULATOR ${WINE}) endif()