Qmake scons 生成器
我们希望使用 scons 在 Windows 上进行构建,主要是因为它的缓存设施(我们在 Linux 上使用 ccache,并且在那里编译速度要快得多)。然而,我们所有的项目都是在 qmake .pro 文件中定义的。现在构建的方式是,我们调用 qmake 来生成 Makefile,然后用它来通过 jom 进行构建。拥有较高级别的 .pro 文件非常实用,因此我们希望保留它,而不是用 SConfigure 文件替换 .pro 文件。因此,理想情况下,我们应该让 qmake 生成一个 SConfigure 文件,就像现在生成 Makefile 一样,然后在该 SConfigure 文件上运行 scons。有没有什么东西可以做到这一点,也许是 qmake 的一些生成器?或者是否可以将 qmake 创建的 Makefile 转换为 SConfigure 文件?
(我知道 scons 和 qmake 的功能重叠,例如依赖项生成,并且单独使用 scons 可能会更好,但是,qmake 对于 Qt 项目非常有效,并且还可以生成 Visual Studio 文件,所以我们想保留它。)
We would like to use scons for building on Windows, mainly because of its caching facilities (we use ccache on Linux, and compiliation is considerably faster there). However, all our projects are defined in qmake .pro files. The way building now works, is that we call qmake to generate a Makefile, which we then use to build with jom. Having .pro files on a high level is quite practical, so we would like to keep that and not replace the .pro files by SConfigure files. So ideally we would have qmake generate a SConfigure file, the same way it generates a Makefile now, and then run scons on that SConfigure file. Is there something out there that can do that, maybe some generator for qmake? Or is it somehow possible to convert the Makefile created by qmake into an SConfigure file?
(I'm aware that the functionality of scons and qmake overlap, for instance the dependency generation and that it would likely be better to use just scons by itself, however, qmake works quite well for Qt projects and can also generate visual studio files, so we would like to keep it.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
他们对元元制作不太满意。然而,正如被拒绝的合并请求中所建议的,使用 QMAKE_SUBSTITUTES 可能会出现一些离源的情况,但这实际上是一个未记录的功能。
或者你可以按照我尝试的方式直接修改代码。看看 https://qt.gitorious。 org/~phresnel/qt/add-some-qmake-to-autotools-glue ,或更具体地说 https://qt.gitorious.org/qt/qt/merge_requests/1040 。文件
qmake/generators/special/filelist.cpp
完成大部分工作。恕我直言,遗憾的是 qmake 的扩展并不容易; CMake更大的灵活性也是我转向它的原因,完全放弃了qmake的使用。
They are not very happy with meta meta makes. However, as suggested in that rejected merge request, something might be possible off-source using QMAKE_SUBSTITUTES, but that is a practically undocumented feature.
Or you could go the way I tried and tinker with the code directly. Have a look at https://qt.gitorious.org/~phresnel/qt/add-some-qmake-to-autotools-glue , or more specifically the diff at https://qt.gitorious.org/qt/qt/merge_requests/1040 . The file
qmake/generators/special/filelist.cpp
does most of the work.Imho, it is really a pity that extension of qmake is not easier; the greater flexibility of CMake was also the reason why I switched to it, completely abandoning my use of qmake.