pmcdona | 0a0a7eb | 2013-12-18 10:17:25 +0800 | [diff] [blame] | 1 | # |
| 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 | |
| 9 | set(CROSS_PATH /usr/bin) |
| 10 | |
| 11 | # Target operating system name. |
| 12 | set(CMAKE_SYSTEM_NAME Windows) |
| 13 | set(BUILD_SHARED_LIBS OFF) |
| 14 | |
| 15 | # Name of C compiler. |
| 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") |
| 20 | |
| 21 | # Where to look for the target environment. (More paths can be added here) |
| 22 | set(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. |
| 26 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) |
| 27 | |
| 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) |
| 31 | |