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