katie/cmake/archlinux-mingw.cmake
Ivailo Monev ace4c699b0 add cmake toolchain file for use on arch linux
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2015-12-16 02:22:09 +02:00

23 lines
820 B
CMake

# use like this: cmake . -DCMAKE_TOOLCHAIN_FILE=cmake/archlinux-mingw.cmake
set(CMAKE_SYSTEM_NAME Windows)
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "(x86_64|amd64)")
set(mingwtriplet "x86_64-w64-mingw32")
else()
set(mingwtriplet "i686-w64-mingw32")
endif()
# which compilers to use for C and C++
set(CMAKE_C_COMPILER ${mingwtriplet}-gcc)
set(CMAKE_CXX_COMPILER ${mingwtriplet}-g++)
set(CMAKE_RC_COMPILER ${mingwtriplet}-windres)
# here is the target environment located
set(CMAKE_FIND_ROOT_PATH /usr/${mingwtriplet})
# 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)