zhangmeng
2023-02-02 8c36971afa38f8a2fb058704d6c584e0ce0c2bc4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# this one is important
SET(CMAKE_SYSTEM_NAME Linux)
#this one not so much
SET(CMAKE_SYSTEM_VERSION 1)
 
SET(ROOT /opt/aarch64)
# specify the cross compiler
SET(CMAKE_C_COMPILER   ${ROOT}/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc)
SET(CMAKE_CXX_COMPILER ${ROOT}/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-g++)
 
# where is the target environment
SET(CMAKE_FIND_ROOT_PATH
   ${ROOT}/sysroot-glibc-linaro-2.23-2017.05-aarch64-linux-gnu
)
 
# 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)