set(CMAKE_SYSTEM_NAME ARM_NONE_EABI)
set(CMAKE_SYSTEM_PROCESSOR ARM)

if(NOT ARM_NONE_EABI_TOOLCHAINS_PATH)
	set(ARM_NONE_EABI_TOOLCHAINS_PATH "d:/mingw64")
endif(NOT ARM_NONE_EABI_TOOLCHAINS_PATH)

set(CMAKE_FIND_ROOT_PATH ${ARM_NONE_EABI_TOOLCHAINS_PATH})

set(CMAKE_C_COMPILER   "${ARM_NONE_EABI_TOOLCHAINS_PATH}/bin/arm-none-eabi-gcc.exe")
set(CMAKE_CXX_COMPILER "${ARM_NONE_EABI_TOOLCHAINS_PATH}/bin/arm-none-eabi-g++.exe")

# tell CMake not to try to link executables during its checks
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)

set(CMAKE_OBJCOPY "${ARM_NONE_EABI_TOOLCHAINS_PATH}/bin/arm-none-eabi-objcopy.exe" CACHE FILEPATH "Path to program objcopy")
set(CMAKE_OBJDUMP "${ARM_NONE_EABI_TOOLCHAINS_PATH}/bin/arm-none-eabi-objdump.exe" CACHE FILEPATH "Path to program objdump")
set(CMAKE_SIZE    "${ARM_NONE_EABI_TOOLCHAINS_PATH}/bin/arm-none-eabi-size.exe" CACHE FILEPATH "Path to program size")
mark_as_advanced(FORCE CMAKE_OBJCOPY)
mark_as_advanced(FORCE CMAKE_OBJDUMP)
mark_as_advanced(FORCE CMAKE_SIZE)

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)
