为什么Qt使用自己的make工具,qmake? [英] Why does Qt use its own make tool, qmake?

查看:308
本文介绍了为什么Qt使用自己的make工具,qmake?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始使用 Qt ,并注意到它使用自己的make工具, qmake

I just started using Qt and noticed that it uses its own make tool, qmake.


  • 为什么Qt使用自己的

  • 是否有特殊的东西阻止它使用标准的make工具?qmake调用 GCC C ++编译器?

  • Why does Qt use its own make tool?
  • Is there something special that prevents it from using a standard make tool?
  • Does qmake call the GCC C++ compiler?

推荐答案

Qt使用qmake透明地支持Qt的各种插件,包括moc,元对象编译器(提供信号和插槽),uic,ui编译器 ),rcc,资源编译器(它编译资源)。

Qt uses qmake to transparently support Qt's various addons, including "moc, the meta-object compiler" (which provides signals & slots), "uic, the ui compiler" (which creates header files from .ui designer files), "rcc, the resource compiler" (which compiles resources).

没有什么可以阻止你使用任何你想要的构建系统。然而,这是一个更多的工作。例如,您需要在每个包含具有信号或槽的类的头文件上运行moc。一般来说,不推荐,特别是对于刚刚开始使用Qt的人。

There's nothing to stop you using any build system you want. however, it's a lot more work. For example, you need to run "moc" over every header file that contains a class that has signals or slots. In general it's not recommended, especially for someone who's just starting to use Qt.

QMake不直接调用g ++ / gcc。相反,qmake在您当前的平台上创建本机make文件。在linux下它创建标准的GNU make文件,在windows下它可以生成visual studio make文件,在Mac OS X下它可以生成XCode项目文件。然后调用您的本机构建系统(GNU make或MS NMake,或xcodebuild或其他),这将调用您的本机编译器(g ++ / gcc或任何)。

QMake does not call g++/gcc directly. Instead, qmake creates native make files on your current platform. Under linux it creates standard GNU make files, under windows it can generate visual studio make files, under Mac OS X it can generate XCode project files. You then invoke your native build system (either GNU make, or MS NMake, or xcodebuild or whatever), which will call your native compiler (g++/gcc or whatever).

这篇关于为什么Qt使用自己的make工具,qmake?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆