当前位置:网站首页>Cpp(三) 什么是CMake
Cpp(三) 什么是CMake
2020-11-07 20:58:00 【Coxhuang】
文章目录
- 什么是CMake
- #1 环境
- #2 Cpp流程
什么是CMake
#1 环境
macOS 10.15.5
#2 Cpp流程
什么是CMake? 需要先了解Cpp的流程
- 用编辑器(VSCode/Clion等)编写源代码,如main.cpp文件
- 用编译器编译代码生成目标文件,如.o
- 用链接器连接目标代码生成可执行文件,如Windows下的.exe和Linux下的可执行文件
- make
如果源文件(.cpp)过多,一个一个编译就会特别麻烦,于是就有了
make
工具,它是一个自动化编译工具,可以使用一条命令实现完全编译,但是开发者需要编写一个规则文件,make依据规则文件来批处理编译,这个文件就是makefile
- CMake
但是对于一个特别巨大的工程来说,编写一个
makefile
确实是一件非常复杂的事情,于是出现了CMake
,CMake负责读入所有源文件,然后自动生成makefile
,但是这时,需要开发者编写一个规则文件,CMake
通过这个规则文件生成makefile
,这个文件就是CMakeLists.txt
所以,一个Cpp工程,从源码到运行,可以手动编写
makefile
文件,然后编译,生成一个可执行文件;也可以编写CMakeLists
文件,通过CMake
工具,自动生成makefile
文件,然后编译生成可执行文件
本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。
版权声明
本文为[Coxhuang]所创,转载请带上原文链接,感谢
https://cloud.tencent.com/developer/article/1744570
边栏推荐
- Implementation of Caesar cipher
- Why do we need software engineering -- looking at a simple project
- Awk implements SQL like join operation
- [original] the influence of arm platform memory and cache on the real-time performance of xenomai
- [random talk] the goal and way of software design
- Big data algorithm - bloon filter
- 一文详解微服务架构
- 聊一聊数据库中的锁
- awk实现类sql的join操作
- 如何以计算机的方式去思考
猜你喜欢
From technology to management, the technology of system optimization is applied to enterprise management
How to choose a good company
使用“1”个参数调用“DownloadString”时发生异常:“操作超时”
Tips for Mac novices
Summary of the resumption of a 618 promotion project
一次公交卡被“盗刷”事件带来的思考
Using pipe() to improve code readability in pandas
The official 1909 version of win10 cannot open the real-time protection solution of virus and threat protection in windows security center.
Git code submission operation, and git push prompt failed to push some refs'xxx '
利用线程通信、解决缓存穿透数据库雪崩
随机推荐
统计文本中字母的频次(不区分大小写)
Using thread communication to solve the problem of cache penetrating database avalanche
微服务的出现和意义的探索
从技术谈到管理,把系统优化的技术用到企业管理
Awk implements SQL like join operation
AC86U kx上网
工作1-3年的程序员,应该具备怎么样的技术能力?该如何提升?
Technical debt is a lack of real understanding of business functions- daverupert.com
构造请求日志分析系统
laravel8更新之维护模式改进
Web安全(三)---CSRF攻击
Kylin on kubernetes' practice on eBay
浅谈HiZ-buffer
Got timeout reading communication packets解决方法
我是如何失去团队掌控的?
不懂数据库索引的底层原理?那是因为你心里没点b树
Why do we need software engineering -- looking at a simple project
The official 1909 version of win10 cannot open the real-time protection solution of virus and threat protection in windows security center.
Kubernetes服务类型浅析:从概念到实践
一次公交卡被“盜刷”事件帶來的思考