summaryrefslogtreecommitdiff
path: root/Toolchain/mingw32.cmake
blob: d59fb4a7b5968c99572ce77ea0cf14b14cd715d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
SET(CMAKE_SYSTEM_NAME Windows)

FIND_PROGRAM(CMAKE_C_COMPILER NAMES i686-mingw32-gcc i586-mingw32-gcc mingw32-gcc)
FIND_PROGRAM(CMAKE_CXX_COMPILER NAMES i686-mingw32-g++ i586-mingw32-gcc mingw32-g++)

FIND_PROGRAM(CMAKE_RC_COMPILER_INIT NAMES i686-mingw32-windres i586-mingw32-windres mingw32-windres)
SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")

EXECUTE_PROCESS( 
   COMMAND ${CMAKE_C_COMPILER} -print-sysroot
   OUTPUT_VARIABLE CMAKE_FIND_ROOT_PATH
)

# Does not work - don't know why
SET(ENV{PKG_CONFIG_SYSROOT_DIR} ${CMAKE_FIND_ROOT_PATH})

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)