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

get_filename_component(TOOLCHAIN_ROOT_PATH "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)

set(CMAKE_MAKE_PROGRAM "${TOOLCHAIN_ROOT_PATH}/tools/ninja.exe" )

set(ARM_TOOLCHAIN_PREFIX "${TOOLCHAIN_ROOT_PATH}/bin/arm-none-eabi-")

set(CMAKE_ASM_COMPILER "${ARM_TOOLCHAIN_PREFIX}gcc.exe" CACHE INTERNAL "CMAKE_ASM_COMPILER")
set(CMAKE_C_COMPILER "${ARM_TOOLCHAIN_PREFIX}gcc.exe" CACHE INTERNAL "CMAKE_C_COMPILER")
set(CMAKE_CXX_COMPILER "${ARM_TOOLCHAIN_PREFIX}g++.exe" CACHE INTERNAL "CMAKE_CXX_COMPILER")
set(CMAKE_OBJCOPY "${ARM_TOOLCHAIN_PREFIX}objcopy.exe" CACHE INTERNAL "CMAKE_OBJCOPY")
set(CMAKE_SIZE_UTIL "${ARM_TOOLCHAIN_PREFIX}size.exe" CACHE INTERNAL "CMAKE_SIZE_UTIL")
set(CMAKE_AR "${ARM_TOOLCHAIN_PREFIX}gcc-ar.exe" CACHE INTERNAL "CMAKE_AR")

set(CMAKE_ASM_COMPILER_ID GNU)
set(CMAKE_C_COMPILER_ID GNU)
set(CMAKE_CXX_COMPILER_ID GNU)

set(CMAKE_ASM_COMPILER_FORCED TRUE)
set(CMAKE_C_COMPILER_FORCED TRUE)
set(CMAKE_CXX_COMPILER_FORCED TRUE)

SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

enable_language(ASM C CXX)