当前位置:网站首页>Qt Creator .pro文件根据kit添加对应库
Qt Creator .pro文件根据kit添加对应库
2022-07-23 06:37:00 【爱学习的诸葛铁锤】
背景
之前搞了双版本的ffmpeg,想着在ubuntu上跑,没问题再编译运行在Arm开发板上
交叉编译ffmpeg+x264+x265 (x86、arm-linux双版本)亲测有效
由于两个版本的库不相同,Qt Creator 编译时要切换的话就很麻烦
想着不如配置一下 .pro 文件使得能够根据当前构建的 kit 来选择对应的库
配置Build
笔者有两个kit,一个是x86_64,一个是arm

找到这个位置,添加 额外的参数 ,为这个 arm kit 添加一个宏定义 "DEFINES+=PLATFORM_ARM"

同理,为另一个x86 kit 再添加一个宏定义 "DEFINES+=PLATFORM_X86"
修改.pro文件
if(contains(DEFINES,PLATFORM_X86)){
message("compile for x86")
INCLUDEPATH += xxxxxxx
LIBS += xxxxxxx
}else{
message("compile for arm")
INCLUDEPATH += xxxxxxx
LIBS += xxxxxxx
}
也就是加一个 if 语句,根据宏定义的别名判断当前构建的 kit ,进而选择添加对应的库
结束语
很实用,浅浅记一下
边栏推荐
猜你喜欢

了解canvas
![[daily training] 814. Binary tree pruning](/img/c1/d71e6190a1855a392689b55503f75e.png)
[daily training] 814. Binary tree pruning

The current situation of the industry is disappointing. After working, I returned to UC Berkeley to study for a doctoral degree

In depth interpretation of EVM's ecological Empire

Beifu PLC and C transmit structure type variables through ads communication

Day 10 notes

【可視化調度軟件】上海道寧為SMB組織帶來NETRONIC下載、試用、教程

MySQL的索引事务&&JDBC编程
![[jzof] path in matrix 12](/img/33/426386fc3dc3e32b6968d30034d66a.png)
[jzof] path in matrix 12
![[jzof] 10 Fibonacci series](/img/65/ab5b22b0879644c210abb38b0ce640.png)
[jzof] 10 Fibonacci series
随机推荐
射击游戏 第 1-2 课:使用精灵
Shooting games lesson 1-2: using sprites
PHP framework MVC class code audit
ROS2自学笔记:URDF机器人建模
【可視化調度軟件】上海道寧為SMB組織帶來NETRONIC下載、試用、教程
Changes in the pattern of NFT trading market: from one dominant company to a hundred schools of thought
[noi simulation race] I don't know which CF paper title it is (probability expectation, martingale's stop time theorem)
第十二天笔记
中国在又一个新兴科技领域领先美国,站在科技创新制高点
0722~线程池扩展
Functional testing to automated testing, sharing ten years of automated testing experience
4D antenna array layout design
Bit synchronization process of CAN controller
倍福PLC和C#通过ADS通信传输int类型变量
High voltage MOS tube knx42150 1500v/3a is applied to frequency converter power supply inverter, etc
Matplotlib- implement common probability distributions
Talk about "people" in the R & D team
Notes on the seventh day
0722~ thread pool extension
Smart city infrastructure management based on bim+3dgis