1#
2# Toolchain for crosscompiling 64bit Windows applications on ArchLinux.
3#
4# Minimal dependencies:
5#
6#     mingw-w64-gcc
7#
8
9# Target system name
10set(CMAKE_SYSTEM_NAME   Windows)
11
12# Compilers and utilities
13set(CMAKE_C_COMPILER    x86_64-w64-mingw32-gcc)
14set(CMAKE_CXX_COMPILER  x86_64-w64-mingw32-g++)
15set(CMAKE_RC_COMPILER   x86_64-w64-mingw32-windres)
16
17# Croscompiler path
18set(CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH}
19    /usr/x86_64-w64-mingw32)
20
21# This helps find_path(), otherwise it's not able to find e.g.
22# /usr/x86_64-w64-mingw32/share/cmake/Corrade/. I don't know why it's needed when
23# there is already CMAKE_FIND_ROOT_PATH, but probably related to
24# http://public.kitware.com/Bug/view.php?id=14337
25set(CMAKE_PREFIX_PATH /usr/x86_64-w64-mingw32)
26
27# Find executables in root path, libraries and includes are in crosscompiler
28# path
29set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
30set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
31set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
32
33# Directories where to search for DLLs
34set(MINGW_PREFIX /usr/x86_64-w64-mingw32)
35set(DLL_SEARCH_PATH
36    ${MINGW_PREFIX}/lib
37    ${MINGW_PREFIX}/bin)
38