How to build qtwayland?

▼魔方 西西 提交于 2019-12-05 19:29:13

Most of the content on the wiki page was written many years ago. I made an effort to clean up things I know are not relevant anymore and hope to get the wiki page in a usable state.

The problem as I see it, is that there are so many ways to build Qt, and how to build QtWayland depends on that.

The two most common options:

Building QtWayland as part of a full (or toplevel Qt build)

When configuring Qt, you can add -feature-wayland-server to you configure line. And it will make sure the wayland compositor API is part of your Qt build. Configure will then fail if the dependencies of QtWayland is not met. I.e. if you need dev packages for Wayland.

Then you can either just run make which will build all of Qt as you configured it, or run make module-qtwayland which should only build QtWayland and the required dependencies (qtbase, qtdeclarative, qtxmlpatterns).

Building QtWayland against an existing Qt installation (without QtWayland)

First you need to find qmake for your desired Qt version. If it's the one provided by the system, it's usually on your PATH already. If you are going to use Qt provided by the Qt installer, it's usually in ~/Qt/5.10.0/gcc_64/bin/qmake or equivalent for your version and architecture.

Clone qtwayland

git clone git://code.qt.io/qt/qtwayland.git
cd qtwayland
git checkout v5.10.0 #or whatever version your qmake reports

Configure with qmake

qmake

or

~/Qt/5.10.0/gcc_64/bin/qmake

You should now see:

Qt Wayland Client ........................ yes
Qt Wayland Compositor .................... yes

In your terminal, or else you are probably missing some dependencies.

Build with make

make
make install

Build examples

Depending on your configuration, this may need to be run explicitly:

make sub-examples
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!