include(CMakeForceCompiler)

set (CMAKE_SYSTEM_NAME      Generic)
set (CMAKE_SYSTEM_PROCESSOR ATmega328)

set (AVRGNU avr-)

CMAKE_FORCE_C_COMPILER(${AVRGNU}gcc   GNU)
CMAKE_FORCE_CXX_COMPILER(${AVRGNU}g++ GNU)

#set (CMAKE_CXX_LINK_EXECUTABLE 
  #"${AVRGNU}ld <LINK_FLAGS> <OBJECTS>  -o <TARGET> <LINK_LIBRARIES>"
#)

set (CMAKE_OBJCOPY ${AVRGNU}objcopy
  CACHE FILEPATH "The toolchain objcopy command " FORCE 
)

set (CMAKE_OBJDUMP ${AVRGNU}objdump
  CACHE FILEPATH "The toolchain objdump command " FORCE 
)

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)
