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