2 # CMake Toolchain file for crosscompiling on MingW.
4 # This can be used when running cmake in the following way:
6 # cmake .. -DCMAKE_TOOLCHAIN_FILE=../cross-ming.cmake
9 set(CROSS_PATH /usr/bin)
11 # Target operating system name.
12 set(CMAKE_SYSTEM_NAME Windows)
13 set(BUILD_SHARED_LIBS OFF)
16 set(CMAKE_C_COMPILER "${CROSS_PATH}/x86_64-w64-mingw32-gcc")
17 #set(CMAKE_CXX_COMPILER "${CROSS_PATH}/x86_64-w64-mingw32-g++")
18 set(CMAKE_RC_COMPILER "${CROSS_PATH}/x86_64-w64-mingw32-windres")
19 set(CMAKE_C_FLAGS "-Wno-error")
21 # Where to look for the target environment. (More paths can be added here)
22 set(CMAKE_FIND_ROOT_PATH "${CROSS_PATH}")
24 # Adjust the default behavior of the FIND_XXX() commands:
25 # search programs in the host environment only.
26 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
28 # Search headers and libraries in the target environment only.
29 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
30 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)