disable diagnostic for luamake
[liba.git] / cmake / UseMinGW32.cmake
blob89d06d66e33df801beaf8d80de84e7550f13af86
1 set(CMAKE_SYSTEM_NAME Windows)
2 set(CMAKE_SYSTEM_PROCESSOR i686)
3 set(CMAKE_TOOLCHAIN_PREFIX i686-w64-mingw32)
4 find_program(CMAKE_AR ${CMAKE_TOOLCHAIN_PREFIX}-gcc-ar)
5 find_program(CMAKE_C_COMPILER ${CMAKE_TOOLCHAIN_PREFIX}-gcc)
6 find_program(CMAKE_CXX_COMPILER ${CMAKE_TOOLCHAIN_PREFIX}-g++)
7 find_program(CMAKE_RANLIB ${CMAKE_TOOLCHAIN_PREFIX}-gcc-ranlib)
8 find_program(CMAKE_RC_COMPILER ${CMAKE_TOOLCHAIN_PREFIX}-windres)
9 set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER} -x assembler-with-cpp)
10 get_filename_component(CMAKE_FIND_ROOT_PATH "${CMAKE_C_COMPILER}" DIRECTORY)
11 get_filename_component(CMAKE_FIND_ROOT_PATH "${CMAKE_FIND_ROOT_PATH}" DIRECTORY)
12 if(UNIX)
13   set(CMAKE_FIND_ROOT_PATH "${CMAKE_FIND_ROOT_PATH}/${CMAKE_TOOLCHAIN_PREFIX}")
14   find_program(CMAKE_CROSSCOMPILING_EMULATOR wine)
15   if(NOT CMAKE_CROSSCOMPILING_EMULATOR)
16     unset(CMAKE_CROSSCOMPILING_EMULATOR CACHE)
17   endif()
18 endif()
19 set(CMAKE_INSTALL_PREFIX ${CMAKE_FIND_ROOT_PATH} CACHE PATH
20   "Install path prefix, prepended onto install directories."
22 if(NOT WIN32)
23   set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
24   set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
25   set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
26   set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
27 endif()
28 if(CMAKE_TOOLCHAIN_FILE)
29 endif()