简体   繁体   English

将Qt qmake Makefile与自定义Makefile混合

[英]Mix Qt qmake Makefile with custom Makefiles

I'm trying to embed Qt on an ARM system, in order to use a touchscreen with my own application. 我试图将Qt嵌入ARM系统中,以便在自己的应用程序中使用触摸屏。 Everything works fine. 一切正常。 In fact I already made a small standalone application to test and it runs perfect. 实际上,我已经制作了一个小型独立应用程序进行测试,并且可以完美运行。

Now I need this Qt application to be linked with the others applications on my system. 现在,我需要将此Qt应用程序与系统上的其他应用程序链接。

The thing is, we have our own Makefile system that creates the packages and other things, and then we just have to send the .deb to the ARM system and unpacked it to have the software installed. 事情是,我们有自己的Makefile系统来创建软件包和其他内容,然后我们只需要将.deb发送到ARM系统并解压缩即可安装软件。 By the way, these makefiles have special rules. 顺便说一下,这些makefile具有特殊的规则。 But I need the Qt makefile's rules too, in order to be able to compile. 但是我也需要Qt makefile的规则,以便能够进行编译。

Is there a way to mix Qt Makefile and my Makefile? 有没有办法混合Qt Makefile和我的Makefile? Do you have an idea? 你有想法吗?

We finally solved the problem : we call qmake in our own makefile to create a makefile for Qt ; 我们终于解决了这个问题:我们在自己的makefile中调用qmake为Qt创建一个makefile; then we simply make the Qt makefile and then create our packages. 然后我们只需制作Qt makefile,然后创建我们的包。 We had another link issue, but we solved it by linking the good libs in the .pro ; 我们还有另一个链接问题,但我们通过在.pro中链接好库解决了该问题。 that was quite easy in fact x) 其实很容易x)

Thanks anyway ! 不管怎么说,还是要谢谢你 !

You can use Q_MAKE_EXTRA_TARGETS to add your custom targets. 您可以使用Q_MAKE_EXTRA_TARGETS添加自定义目标。

The other lesser known variable is QMAKE_EXTRA_TARGETS, this is useful when you want to be able to add a custom build target to your Makefile. 另一个鲜为人知的变量是QMAKE_EXTRA_TARGETS,当您希望能够向Makefile中添加自定义构建目标时,此变量很有用。 For example, if you wanted to have a target to update your qm file for your application. 例如,如果您想要一个目标来更新应用程序的qm文件。

from The power of qmake 来自qmake的力量

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

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