aboutsummaryrefslogtreecommitdiff
path: root/cmake/toolchain/x86_64-w64-mingw32.cmake
blob: e5f8b085693f35ff93e3e439cf0427917ea1cf14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# the name of the target operating system
SET(CMAKE_SYSTEM_NAME      Windows)
SET(CMAKE_SYSTEM_PROCESSOR x86_64)


# Check path
if(EXISTS /usr/bin/x86_64-w64-mingw32-gcc)
    # which compilers to use for C and C++ and ASM-ATT
    SET(CMAKE_C_COMPILER       /usr/bin/x86_64-w64-mingw32-gcc)
    SET(CMAKE_CXX_COMPILER     /usr/bin/x86_64-w64-mingw32-g++)
    SET(CMAKE_ASM-ATT_COMPILER /usr/bin/x86_64-w64-mingw32-as)

    # here is the target environment located
    SET(CMAKE_FIND_ROOT_PATH  /usr/x86_64-w64-mingw32)
elseif(EXISTS /usr/local/opt/mingw-w64/toolchain-x86_64/bin/x86_64-w64-mingw32-gcc)
    # which compilers to use for C and C++ and ASM-ATT
    SET(CMAKE_C_COMPILER       /usr/local/opt/mingw-w64/toolchain-x86_64/bin/x86_64-w64-mingw32-gcc)
    SET(CMAKE_CXX_COMPILER     /usr/local/opt/mingw-w64/toolchain-x86_64/bin/x86_64-w64-mingw32-g++)
    SET(CMAKE_ASM-ATT_COMPILER /usr/local/opt/mingw-w64/toolchain-x86_64/bin/x86_64-w64-mingw32-as)

    # here is the target environment located
    SET(CMAKE_FIND_ROOT_PATH  /usr/local/opt/mingw-w64/toolchain-x86_64/x86_64-w64-mingw32)
endif()

# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)