简体   繁体   English

是否可以在不使用qmake的情况下编译使用qmake创建的项目?

[英]Can a project created with qmake be compiled without using qmake?

I have some source code that was built with qmake. 我有一些用qmake构建的源代码。 Compiling it is supposed to be done with qmake qmakefile.pro . 应该使用qmake qmakefile.pro

I'd like to compile it without using qmake. 我想使用qmake进行编译。 Is that even possible? 那有可能吗? What would the steps be? 将采取什么步骤?

Edit: Here's the .pro file . 编辑: 这是.pro文件

Yes, you can compile files without qmake . 是的,您可以不使用qmake来编译文件。

You need to get any specific compiler settings from qmake and convert them to the other compiler as necessary. 您需要从qmake获取任何特定的编译器设置,并根据需要将它们转换为其他编译器。

Or you can convert the contents of the qmake.pro file into a makefile or your IDE's project settings. 或者,您可以将qmake.pro文件的内容转换为makefile或IDE的项目设置。

If the qmake.pro is not a human readable text file, you will have to launch qmake and retrieve the settings. 如果qmake.pro不是人类可读的文本文件,则必须启动qmake并检索设置。 Otherwise search for a conversion tool. 否则,请搜索转换工具。

While it is technically possible to translate the .pro file into something else, I would not advise it. 虽然从技术上讲可以将.pro文件转换为其他文件,但我不建议这样做。

Why? 为什么?

  • QMake does a lot of work behind the scenes. QMake在幕后做了很多工作。
    • In the case of the .pro file you referenced ( http://pastebin.com/viv204Fv ), QMake is invoking meta-tools (uic, moc) to create the code for the UI and adding build rules to compile it. 对于您引用的.pro文件( http://pastebin.com/viv204Fv),QMake正在调用元工具(uic,moc)来为UI创建代码并添加构建规则以对其进行编译。 You will need to manually code those in your build script. 您将需要在构建脚本中手动编写代码。 -. - QMake also solves issues of choosing the right compiler and linker options (including the right include files). QMake还解决了选择正确的编译器和链接器选项(包括正确的包含文件)的问题。 You will need to determine them yourself and add them to your build script. 您将需要自己确定它们并将它们添加到您的构建脚本中。
  • The project is already using Qt, so why not use Qt's build script generating tool, QMake? 该项目已经在使用Qt,为什么不使用Qt的生成脚本生成工具QMake? If you have installed a Qt development environment, you should already have qmake installed. 如果已经安装了Qt开发环境,则应该已经安装了qmake。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM