让 QMake 生成正确的 .app
我有一个大型现有 C++ 项目,涉及:
- 4 个应用程序
- 50 多个库
- 20 多个第三方库
该项目使用 QMake(Trolltech Qt 的一部分)在 Linux 上构建生产版本,但我一直在 MacOS 上构建它。
我可以使用 QMake 在 MacOS 上构建,但我在生成最终的 .app 时遇到问题。 它需要收集所有第三方框架和动态库、所有项目的动态库并确保应用程序找到它们。
我在网上阅读过有关使用 install_name_tool 的信息,但想知道是否有一个流程可以使其自动化。
(也许答案是使用 XCode,请参阅相关问题,但构建 uic 和 moc 时会出现问题)
谢谢
I have a large exiting C++ project involving:
- 4 applications
- 50+ libraries
- 20+ third party libraries
The project uses QMake (part of Trolltech's Qt) to build the production version on Linux, but I've been playing around at building it on MacOS.
I can build in on MacOS using QMake just fine but I'm having trouble producing the final .app. It needs collecting all the third party frameworks and dynamic libraries, all the project's dynamic libraries and making sure the application finds them.
I've read online about using install_name_tool but was wondering if there's a process to automate it.
(Maybe the answer is to use XCode, see related question, but it would have issues with building uic and moc)
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我们在 Last.fm 也有同样的问题,我查看了 DeployQt,如果你有第三方库,它就没有多大用处。 最后,我编写了一个生成 Makefile 的 perl 脚本,您可以使用它来生成 .app 和/或 .dmg。
我在这里上传: http://www.methylblue.com/detritus/QMake.dmg/
要使用它,请将其添加到您的应用程序的 pro 文件中:
我确信它还不是可移植的,但对其他人来说使用并查看是否如此将是有好处的。
这基本上是该代码的第一个正式版本,因此请向我发送错误报告以及改进。 谢谢。
We have the same problem at Last.fm, I looked at DeployQt and it's not much use if you have third party libraries. In the end I wrote a perl script that generates a Makefile, which you can use to generate a .app and/or .dmg.
I uploaded it here: http://www.methylblue.com/detritus/QMake.dmg/
To use it add this to your application's pro file:
I'm sure it's not all yet portable, but it would be good for someone else to use and see if that is so.
This is basically the first official release of this code, so please send me bug reports, and also, improvements. Thanks.
我确信这会对您有很大帮助:
deployqt
希望这有帮助!
I'm sure this could be of some great help for you :
deployqt
Hope this helps !
我通过在 OS X 上静态构建 Qt 应用程序来完全回避了这个问题。但这对您来说可能不切实际。
I side-stepped this problem completely by building my Qt app statically on OS X. That might not be practical for you though.