[CMAKE]: Add full support for linking RC files with windres.
[reactos.git] / toolchain-mingw32.cmake
1
2 SET(ARCH i386)
3
4 # Choose the right MinGW prefix
5 if (CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
6 set(MINGW_PREFIX "")
7 else()
8 set(MINGW_PREFIX "mingw32-")
9 endif()
10
11 # the name of the target operating system
12 SET(CMAKE_SYSTEM_NAME Windows)
13 SET(CMAKE_SYSTEM_PROCESSOR i686)
14
15 # which compilers to use for C and C++
16 SET(CMAKE_C_COMPILER ${MINGW_PREFIX}gcc)
17 SET(CMAKE_CXX_COMPILER ${MINGW_PREFIX}g++)
18 SET(CMAKE_RC_COMPILER ${MINGW_PREFIX}windres)
19 SET(CMAKE_ASM_COMPILER ${MINGW_PREFIX}gcc)
20 SET(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -x assembler-with-cpp -o <OBJECT> <FLAGS> <DEFINES> -D__ASM__ -c <SOURCE>")
21 SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff -I${REACTOS_SOURCE_DIR}/include/ -I${REACTOS_BINARY_DIR}/include/reactos -i <SOURCE> -o <OBJECT> <DEFINES> -DRC_INVOKED")
22
23 # adjust the default behaviour of the FIND_XXX() commands:
24 # search headers and libraries in the target environment, search
25 # programs in the host environment
26 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
27 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
28 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)