create a_regress_simple_evar
[liba.git] / cmake / UseMinGW32.cmake
blob1e6aa0148df3110031b8272a04f249c91a314ef2
1 set(CMAKE_SYSTEM_NAME Windows)
2 set(CMAKE_SYSTEM_PROCESSOR i686)
3 set(CMAKE_TOOLCHAIN_PREFIX i686-w64-mingw32)
4 find_program(CMAKE_C_COMPILER NAMES
5   ${CMAKE_TOOLCHAIN_PREFIX}-clang
6   ${CMAKE_TOOLCHAIN_PREFIX}-gcc
8 find_program(CMAKE_CXX_COMPILER NAMES
9   ${CMAKE_TOOLCHAIN_PREFIX}-clang++
10   ${CMAKE_TOOLCHAIN_PREFIX}-g++
12 find_program(CMAKE_AR NAMES
13   ${CMAKE_TOOLCHAIN_PREFIX}-llvm-ar
14   ${CMAKE_TOOLCHAIN_PREFIX}-gcc-ar
16 find_program(CMAKE_RANLIB NAMES
17   ${CMAKE_TOOLCHAIN_PREFIX}-llvm-ranlib
18   ${CMAKE_TOOLCHAIN_PREFIX}-gcc-ranlib
20 find_program(CMAKE_RC_COMPILER ${CMAKE_TOOLCHAIN_PREFIX}-windres)
21 set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER} -x assembler-with-cpp)
22 get_filename_component(CMAKE_FIND_ROOT_PATH "${CMAKE_C_COMPILER}" DIRECTORY)
23 get_filename_component(CMAKE_FIND_ROOT_PATH "${CMAKE_FIND_ROOT_PATH}" DIRECTORY)
24 if(UNIX)
25   set(CMAKE_FIND_ROOT_PATH "${CMAKE_FIND_ROOT_PATH}/${CMAKE_TOOLCHAIN_PREFIX}")
26   find_program(CMAKE_CROSSCOMPILING_EMULATOR wine)
27   if(NOT CMAKE_CROSSCOMPILING_EMULATOR)
28     unset(CMAKE_CROSSCOMPILING_EMULATOR CACHE)
29   endif()
30 endif()
31 set(CMAKE_INSTALL_PREFIX ${CMAKE_FIND_ROOT_PATH} CACHE PATH
32   "Install path prefix, prepended onto install directories."
34 if(NOT WIN32)
35   set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
36   set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
37   set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
38   set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
39 endif()
40 if(CMAKE_TOOLCHAIN_FILE)
41 endif()