1 # Toolchain file for building for Windows from Ubuntu.
3 # Use: cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw64.cmake
5 SET(CMAKE_SYSTEM_NAME Windows)
7 set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
9 SET(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
10 SET(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
11 SET(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
13 # Set target environment path
14 SET(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
16 # Adjust the default behaviour of the find_XXX() commands:
17 # search headers and libraries in the target environment, search
18 # programs in the host environment
19 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
20 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
21 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
23 set(CVC4_WINDOWS_BUILD TRUE)