当前位置:网站首页>CMake交叉编译
CMake交叉编译
2022-07-02 09:41:00 【wangzai6378】
原有CMakeLists.txt中的内容保持不变。新增加一个文件,如toolChain.cmake
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_C_COMPILER /opt/tools/cgtools/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER /opt/tools/cgtools/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-g++)
set(CMAKE_CROSSCOMPILING TRUE)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_FIND_ROOT_PATH /opt/tools/cgtools/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu/aarch64-none-linux-gnu/lib64
/opt/cross/3rdparty/include
/opt/cross/3rdparty/lib/aarch64)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) #可执行程序不仅仅只是在设置的ROOT_PATH查找
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) #只在设置的ROOT_PATH下查找库
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) #只在设置的ROOT_PATH下查找头文件
在运行cmake的时候指定TOOLCHAIN_FILE, 如:cmake -DCMAKE_TOOLCHAIN_FILE=./toolChain.cmake ..
然后 make即可
边栏推荐
- [idea] use the plug-in to reverse generate code with one click
- Develop scalable contracts based on hardhat and openzeppelin (I)
- 基于Hardhat编写合约测试用例
- R HISTOGRAM EXAMPLE QUICK REFERENCE
- mysql 基本语句
- GGHIGHLIGHT: EASY WAY TO HIGHLIGHT A GGPLOT IN R
- Visualization of chip SEQ data by deeptools
- Attribute acquisition method and operation notes of C # multidimensional array
- MySQL linked list data storage query sorting problem
- 2022年遭“挤爆”的三款透明LED显示屏
猜你喜欢
K-Means Clustering Visualization in R: Step By Step Guide
Mmrotate rotation target detection framework usage record
GGPUBR: HOW TO ADD ADJUSTED P-VALUES TO A MULTI-PANEL GGPLOT
2022年遭“挤爆”的三款透明LED显示屏
文件操作(详解!)
动态内存(进阶四)
JS——每次调用从数组里面随机取一个数,且不能与上一次为同一个
pgsql 字符串转数组关联其他表,匹配 拼接后原顺序展示
MySQL比较运算符IN问题求解
vant tabs组件选中第一个下划线位置异常
随机推荐
通过券商经理的开户二维码开股票账户安全吗?还是去证券公司开户安全?
Jenkins installation
6. Introduce you to LED soft film screen. LED soft film screen size | price | installation | application
II Stm32f407 chip GPIO programming, register operation, library function operation and bit segment operation
JS——每次调用从数组里面随机取一个数,且不能与上一次为同一个
Esp32 audio frame esp-adf add key peripheral process code tracking
C#基于当前时间,获取唯一识别号(ID)的方法
C file and folder operation
在连接mysql数据库的时候一直报错
tidb-dm报警DM_sync_process_exists_with_error排查
spritejs
Homer forecast motif
文件操作(详解!)
Digital transformation takes the lead to resume production and work, and online and offline full integration rebuilds business logic
How to Easily Create Barplots with Error Bars in R
[idea] use the plug-in to reverse generate code with one click
CentOS8之mysql基本用法
Resources reads 2D texture and converts it to PNG format
接口调试工具概论
Tiktok overseas tiktok: finalizing the final data security agreement with Biden government