set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
# set toolchain path
set(sysroot_target /opt/poky/3.1.4/sysroots/aarch64-poky-linux)
set(tools /opt/poky/3.1.4/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux)
set(CMAKE_C_COMPILER ${tools}/aarch64-poky-linux-gcc)
set(CMAKE_CXX_COMPILER ${tools}/aarch64-poky-linux-g++)
set(CMAKE_SYSROOT ${sysroot_target})
SET(CMAKE_CXX_FLAGS " -mcpu=cortex-a72+crc+crypto -Og -pipe -g --sysroot=${sysroot_target}")
SET(CMAKE_C_FLAGS ${CMAKE_CXX_FLAGS})
SET(CMAKE_EXE_LINKER_FLAGS "--sysroot=${sysroot_target}")
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)
