当前位置:网站首页>What is make makefile cmake qmake and what is the difference?
What is make makefile cmake qmake and what is the difference?
2022-07-07 05:50:00 【Big fish don't eat fish (wanna)】
author : Know user
link :https://www.zhihu.com/question/27455963/answer/89770919
source : You know
1.gcc yes GNU Compiler Collection( Namely GNU Compiler Suite ), You can also think of it as a compiler , It can compile many programming languages ( enclosed C、C++、Objective-C、Fortran、Java wait ).
2. When your program has only one source file , It can be used directly gcc Command to compile it .
3. But when your program contains many source files , use gcc When the commands are compiled one by one , You're easily confused and have a lot of work
4. So it's here make Tools make Tools can be seen as an intelligent batch tool , It doesn't compile and link itself , But in a way similar to batch processing — By calling makefile The command specified by the user in the file is used for compiling and linking .
5.makefile What is it? ? In short, it's like the score of a song ,make Tools are like conductors , The conductor directed the whole orchestra according to the score ,make Tools are based on makefile The commands in are compiled and linked .
6.makefile The command contains the call gcc( It can also be another compiler ) The command to compile a source file .
7.makefile In some simple projects, it can be done manually , But when the project is very big , Handwriting makefile It's also very troublesome , If we change the platform makefile And revise it again .
8. That's when Cmake This tool ,cmake It's easier to generate makefile The document is for the one above make use . Of course cmake There are other functions , That is, it can generate the corresponding platform that can be used across platforms makefile, You don't have to modify it yourself .
9. But cmake According to what makefile Well ? It's also based on a call CMakeLists.txt file ( A scientific name : Configuration files ) To generate makefile.
10. In the end CMakeLists.txt Who wrote the document ? Pro - , You wrote it yourself .
11. Of course, if you use IDE, similar VS Generally, it can help you to finish , You just need to press that triangle
12. Next is qmake,qmake What is it? , But first, let me say Qt This thing .Qt It's cross platform C++ GUI application development framework . It can develop GUI Program , It can also be used to develop non GUI Program , For example, console tools and servers . Simply put C++ Third party library , Using this library, you can easily generate windows,Linux,MAC os And so on . current Qt It also includes the functional modules commonly used in the development of various software ( The Internet , database ,XML, Multithreading, etc ), It's better than using it directly C++( Only bring standard underwear ) Be convenient and simple .
13. You can use it. Qt Simply implement very complex functions , Because Qt Yes C++ It has been extended , You write a line of code ,Qt I wrote hundreds of lines for you behind your back , And the extra code depends on Qt Proprietary moc compiler (The Meta-Object Compiler) and uic compiler (User Interface Complier) To retranslate your line of code . The problem is coming. , You must call before compiling the program moc and uic Yes Qt Preprocess the source file , Then call the compiler to compile . The kind mentioned above is ordinary makefile The document is not applicable , It can't be right qt Preprocess the source file . therefore qmake It came into being. .
14.qmake Tool is Qt Made by the company , Used to generate Qt special makefile file , such makefile Files can be automatically and intelligently called moc and uic Preprocess and compile the source program .qmake Of course, it must also be cross platform , Follow cmake It can also generate corresponding for various platforms makefile file .
15.qmake It's based on Qt Engineering documents (.pro) To generate the corresponding makefile Of . Engineering documents (.pro) Relatively simple , You can write your own handwriting for general projects , But it is usually made up of Qt Development environment of Qt Creator Automatically generated , You just need to press the evil triangle to finish .
16. It's not over yet , because qmake It is very simple and easy to use, and supports cross platform , And it can be independent of it IDE, So you can also use it in non Qt Above the project , You can still generate ordinary makefile, As long as pro Add... To the document CONFIG -= qt That's all right. .
17、 such qmake and cmake What's the difference? ? sorry ,cmake It also supports Qt programmatic ,cmake It can also be generated for qt The kind of special program makefile, It's just cmake Of CMakeLists.txt Written relative to qmake Of pro The file is more complicated . qmake Is for Qt tailor-made , It is very convenient to use , however cmake Functional ratio qmake Powerful . General Qt You can use it directly in the project qmake That's all right. ,cmake The powerful function of is not available to ordinary people . When your project is very large , And then there is qt Part of the subproject , There are some sub projects in other languages , It is said that cmake It will be convenient , I haven't tried .
边栏推荐
- Leetcode: maximum number of "balloons"
- Lombok plug-in
- 关于服装ERP,你知道多少?
- Leetcode 1189 maximum number of "balloons" [map] the leetcode road of heroding
- [reading of the paper] a multi branch hybrid transformer network for channel terminal cell segmentation
- MySQL-CentOS7通过YUM安装MySQL
- 980. 不同路径 III DFS
- Reading notes of Clickhouse principle analysis and Application Practice (6)
- 三级菜单数据实现,实现嵌套三级菜单数据
- OpenSergo 即将发布 v1alpha1,丰富全链路异构架构的服务治理能力
猜你喜欢

Preliminary practice of niuke.com (9)

《ClickHouse原理解析与应用实践》读书笔记(6)

《2022中国低/无代码市场研究及选型评估报告》发布

Dynamic memory management

Pinduoduo product details interface, pinduoduo product basic information, pinduoduo product attribute interface

PowerPivot——DAX(函数)

How digitalization affects workflow automation

OpenSergo 即将发布 v1alpha1,丰富全链路异构架构的服务治理能力
![[binary tree] binary tree path finding](/img/34/1798111e9a294b025806a4d2d5abf8.png)
[binary tree] binary tree path finding

分布式事务解决方案之2PC
随机推荐
Sidecar mode
淘宝商品详情页API接口、淘宝商品列表API接口,淘宝商品销量API接口,淘宝APP详情API接口,淘宝详情API接口
SQL query: subtract the previous row from the next row and make corresponding calculations
Forkjoin is the most comprehensive and detailed explanation (from principle design to use diagram)
Explication contextuelle du langage Go
Type de texte de commutation d'entrée et de mot de passe de l'applet natif
Digital innovation driven guide
JD commodity details page API interface, JD commodity sales API interface, JD commodity list API interface, JD app details API interface, JD details API interface, JD SKU information interface
Three level menu data implementation, nested three-level menu data
What are the common message queues?
Red Hat安装内核头文件
pytorch_ 01 automatic derivation mechanism
软件测试面试技巧
拼多多商品详情接口、拼多多商品基本信息、拼多多商品属性接口
Preliminary practice of niuke.com (9)
4. Object mapping Mapster
Taobao Commodity details page API interface, Taobao Commodity List API interface, Taobao Commodity sales API interface, Taobao app details API interface, Taobao details API interface
盘点国内有哪些EDA公司?
往图片添加椒盐噪声或高斯噪声
MySQL-CentOS7通过YUM安装MySQL