release 0.1.7
[liba.git] / cmake / UseMinGW64.cmake
blob1d52006af2e3642af09d7ae996648fbaac4c26ca
1 set(CMAKE_SYSTEM_NAME Windows)
2 set(CMAKE_SYSTEM_PROCESSOR x86_64)
3 set(CMAKE_TOOLCHAIN_PREFIX x86_64-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 wine64)
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()