set(MINGW_TOOLCHAIN @MINGW_TOOLCHAIN@) set(MINGW_ROOT "/usr/${MINGW_TOOLCHAIN}") set(CMAKE_CROSSCOMPILING ON) set(CMAKE_SYSTEM_NAME Windows) string(REPLACE "-w64-mingw32" "" CMAKE_SYSTEM_PROCESSOR "${MINGW_TOOLCHAIN}") 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_INCLUDE ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${MINGW_ROOT}") endif() find_program(WINE wine) if(WINE) set(CMAKE_CROSSCOMPILING_EMULATOR ${WINE}) endif()