[CMAKE]: Detect correct MinGW compiler on Windows vs Linux/Darwin.
[reactos.git] / toolchain-mingw32.cmake
1 # Choose the right MinGW prefix
2 if (CMAKE_SYSTEM_NAME STREQUAL Windows)
3 set(MINGW_PREFIX "")
4 else()
5 set(MINGW_PREFIX "mingw32-")
6 endif()
7
8 # the name of the target operating system
9 SET(CMAKE_SYSTEM_NAME Windows)
10 SET(CMAKE_SYSTEM_PROCESSIR i686)
11
12 # which compilers to use for C and C++
13 SET(CMAKE_C_COMPILER ${MINGW_PREFIX}gcc)
14 SET(CMAKE_CXX_COMPILER ${MINGW_PREFIX}g++)
15
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 ONLY)
21 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)