当前位置:网站首页>cmake常用命令
cmake常用命令
2022-06-11 02:00:00 【玛了个玛卡巴卡】
project(工程名)
#必需
set(变量名 路径)
#定义变量,在之后可以使用${变量名}来表示路径
file(GLOB 变量名 globbing表达式)
#会产生一个由所有匹配globbing表达式的文件组成的列表,并将其保存到变量中
file(GLOB_RECURSE 变量名 globbing表达式)
#与GLOB类似,区别在于会遍历匹配目录的所有文件以及子目录下面的文件
add_compile_options(编译选项)
#添加编译选项,如-g -std=c++17 -O2
include_directories(头文件路径)
#加入头文件搜索路径
link_directories(库文件基准路径)
#指定库文件基准路径,必须写在add_executable之前
#库文件是已经编译好的程序,使用库文件而不是源文件可以大大缩短编译时间
#库文件分为静态库和动态库。静态库在程序编译时被链接到目标代码中。
#动态库(共享库)在程序编译时并不会被链接到目标代码中,而是在程序运行时才载入;
#不同程序需要相同的库时,在内存中只需要有一份该共享库的拷贝,避免了空间浪费问题;
#并且在运行时才会被载入,也解决了静态库对程序的更新,部署和发布带来的麻烦
add_executable(生成可执行文件名 要编译文件的路径1 要编译文件的路径2 ...)
#必需
target_link_libraries(生成可执行文件名 库文件路径)
#链接共享库,必须写在add_executable之后
边栏推荐
- Project load failed
- A collection of common ADB commands for app testing
- 378. the k-th smallest element in an ordered matrix
- Test questions and answers of 2022r1 quick opening pressure vessel operation certificate
- Metal organic framework MOF Al (Diba), MOF Zr (Diba), MOF Fe (Diba) loaded with curcumin / carboxybenzylpenicillin /mtx methotrexate / paclitaxel ptx/ DOX / cisplatin cddp/cpt camptothecin and other d
- Why can some programmers get good offers with average ability?
- 金属有机框架MOF-Al(DIBA),MOF-Zr(DIBA),MOF-Fe(DIBA)包载姜黄素/羧苄西林/MTX甲氨蝶呤/紫杉醇PTX/阿霉素DOX/顺铂CDDP/CPT喜树碱等药物
- 2022 safety officer-a certificate special operation certificate examination question bank and simulation examination
- 3P5 Industrial Engineering Lecture 1-2: Method of Study
- 力扣刷题篇——哈希表
猜你喜欢

Sd3.0 notes

What is the relationship between precious metal silver and spot Silver

CPT 102_LEC 16

Introduction for i-Teams

The most complete format description of clang format

叶酸配体的金属有机骨架材料MOFs负载5-氟尿嘧啶,西达本胺,紫杉醇,阿霉素,柔红霉素,布洛芬,喜树碱,姜黄素,藤黄酸等小分子药物

如何3步精读《PMBOK指南》(经验+资料分享)

Technology sharing | quick intercom, global intercom

金属有机框架MOF-Al(DIBA),MOF-Zr(DIBA),MOF-Fe(DIBA)包载姜黄素/羧苄西林/MTX甲氨蝶呤/紫杉醇PTX/阿霉素DOX/顺铂CDDP/CPT喜树碱等药物

Everything实现快速搜索的原理
随机推荐
项目 - Redis消息队列+工作线程取出用户操作日志并入库(二)
STC8A8K64D4 EEPROM读写失败
Cyclodextrin metal organic framework( β- Cd-mof) loaded with dimercaptosuccinic acid / emodin / quercetin / sucralose / diflunisal / omeprazole (OME)
2022 simulated 100 questions and answers for crane driver (limited to bridge crane) examination
Dynamically add attributes to objects
年金保险理财产品可以复利吗?利率是多少?
Unity serial port communication
What can the enterprise exhibition hall design bring to the enterprise?
如何保障数仓数据质量?
软件测试英语常见词汇
Jetpack Compose Box控件
Record scroll bar position, passive, scrolltop
GCC C内联汇编
Everything实现快速搜索的原理
2022 safety officer-b certificate examination question bank and answers
[MySQL 45 lecture -12] lecture 12 the reason why MySQL has a wind attack from time to time
Istio installation and use
421. maximum XOR value of two numbers in the array
The most complete format description of clang format
JS summary of math functions in math objects