set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_CROSSCOMPILING 1)

file(TO_CMAKE_PATH $ENV{GNUARMEMB_TOOLCHAIN_PATH} GNUARMEMB_TOOLCHAIN_PATH)

set(CMAKE_AR           ${GNUARMEMB_TOOLCHAIN_PATH}/bin/arm-none-eabi-ar.exe)
set(CMAKE_ASM_COMPILER ${GNUARMEMB_TOOLCHAIN_PATH}/bin/arm-none-eabi-gcc.exe)
set(CMAKE_C_COMPILER   ${GNUARMEMB_TOOLCHAIN_PATH}/bin/arm-none-eabi-gcc.exe)
set(CMAKE_CXX_COMPILER ${GNUARMEMB_TOOLCHAIN_PATH}/bin/arm-none-eabi-g++.exe)
set(CMAKE_LINKER       ${GNUARMEMB_TOOLCHAIN_PATH}/bin/arm-none-eabi-ld.exe)
set(CMAKE_OBJCOPY      ${GNUARMEMB_TOOLCHAIN_PATH}/bin/arm-none-eabi-objcopy.exe CACHE INTERNAL "")
set(CMAKE_RANLIB       ${GNUARMEMB_TOOLCHAIN_PATH}/bin/arm-none-eabi-ranlib.exe CACHE INTERNAL "")
set(CMAKE_SIZE         ${GNUARMEMB_TOOLCHAIN_PATH}/bin/arm-none-eabi-size.exe CACHE INTERNAL "")
set(CMAKE_STRIP        ${GNUARMEMB_TOOLCHAIN_PATH}/bin/arm-none-eabi-strip.exe CACHE INTERNAL "")

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

set(CMAKE_C_COMPILER_FORCED   1)
set(CMAKE_CXX_COMPILER_FORCED 1)
