set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)

set(CMAKE_C_FLAGS "-Wall -Wno-unknown-pragmas")
set(CMAKE_C_FLAGS_DEBUG "-g -O0")
set(CMAKE_C_FLAGS_RELEASE "-O3 -s")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11")
set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})

set(CMAKE_CROSSCOMPILING TRUE)
if (NOT DEFINED TARGET_ABI)
  set(TARGET_ABI "linux-gnueabihf")
endif()
set(CMAKE_C_COMPILER arm-${TARGET_ABI}-gcc)
set(CMAKE_CXX_COMPILER arm-${TARGET_ABI}-g++)
set(CMAKE_LINKER ${TARGET_ABI}-gcc)
SET(CMAKE_FIND_ROOT_PATH "/usr/arm-${TARGET_ABI}")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
