1if (NOT MXE_HOME) 2 set(MXE_HOME $ENV{MXE_HOME}) 3endif() 4if (NOT MXE_HOME) 5 message(FATAL_ERROR "Please setup MXE_HOME environment variable") 6endif() 7 8if (NOT MXE_CFG) 9 set(MXE_CFG $ENV{MXE_CFG}) 10 if (NOT MXE_CFG) 11 set(MXE_CFG "x86_64-w64-mingw32.static") 12 endif() 13endif() 14 15set(CMAKE_SYSTEM_NAME Windows) 16set(CMAKE_SYSTEM_PROCESSOR x86_64) 17set(MSYS 1) 18set(CMAKE_FIND_ROOT_PATH ${MXE_HOME}/usr/${MXE_CFG}) 19set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 20set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 21set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 22set(CMAKE_C_COMPILER ${MXE_HOME}/usr/bin/${MXE_CFG}-gcc) 23set(CMAKE_CXX_COMPILER ${MXE_HOME}/usr/bin/${MXE_CFG}-g++) 24set(CMAKE_RC_COMPILER ${MXE_HOME}/usr/bin/${MXE_CFG}-windres) 25set(CMAKE_MODULE_PATH "${MXE_HOME}/src/cmake" ${CMAKE_MODULE_PATH}) # For mxe FindPackage scripts 26#set(CMAKE_INSTALL_PREFIX ${MXE_HOME}/usr/x86_64-w64-mingw32.static CACHE PATH "Installation Prefix") 27set(CMAKE_CROSS_COMPILING ON) # Workaround for http://www.cmake.org/Bug/view.php?id=14075 28set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <FLAGS> <DEFINES> -o <OBJECT> <SOURCE>") # Workaround for buggy windres rules 29set(PKG_CONFIG_EXECUTABLE ${MXE_HOME}/usr/bin/${MXE_CFG}-pkg-config) 30