if(PLAT_ARM64) # this one is important SET(CMAKE_SYSTEM_NAME Linux) #this one not so much SET(CMAKE_SYSTEM_VERSION 1) # this is install root directory SET(CMAKE_INSTALL_PREFIX /usr) # specify the cross compiler SET(CMAKE_C_COMPILER aarch64-linux-gnu-gcc) SET(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++) SET(CMAKE_STRIP aarch64-linux-gnu-strip) # specify the cross compile and link flags set(CMAKE_C_FLAGS "--sysroot=$ENV{SDKTARGETSYSROOT}") set(CMAKE_SHARED_LINKER_FLAGS "--sysroot=$ENV{SDKTARGETSYSROOT}") SET(CMAKE_LIBRARY_PATH $ENV{SDKTARGETSYSROOT}/usr/lib) # where is the target environment SET(CMAKE_FIND_ROOT_PATH ${SDKTARGETSYSROOT}) # search for programs in the build host directories SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # for libraries and headers in the target directories SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) endif()