How do I get Qt SDK configured properly with Yocto project?

anat0lius picture anat0lius · Oct 26, 2016 · Viewed 7.6k times · Source

I'm new to Yocto Project. The initial idea is to create a custom image based on core-image-full-cmdline (this is with no windowing system) and generate a Qt5 SDK against this image.

  • So my target to be able to run Qt applications needs to have some headers & libraries installed, isn't ? What I must specify on my image recipe ?
  • Doing $ bitbake my_image -c populate_sdk will generate my_image with Qt5 support + SDK installer ?

As I understood, to get a Qt SDK the steps would be:

  1. Download and add meta-qt5 to bblayers.conf.

  2. Add to the image recipe against which you want to build the SDK: inherit populate_sdk_qt5

  3. Configure the SDK build (add/remove features). <- Here I need help. I only want EGLFS support, no X11/Wayland and no Qtwebkit (and idk, maybe some other features that I'm not aware yet).
  4. bitbake my_image -c populate_sdk

My build got an error compiling wayland although I have this: DISTRO_FEATURES_remove = "x11 wayland"

Answer

anat0lius picture anat0lius · Nov 2, 2016

I made some mistakes. So these are the steps:

  1. Download and add meta-qt5 to bblayers.conf.

  2. Add to the image recipe against which you want to build the SDK: inherit populate_sdk_qt5. Now the do_populate_sdk task knows the target and will install the needed headers and libs on the respective sysroot (which will be needed later to be able to configure QtCreator per example)

    2.1 As we gonna generate an SDK, dev packages are needed. Add this to the image recipe: IMAGE_FEATURES += "dev-pkgs"

    2.2 If our distro doesn't have any windows manager: DISTRO_FEATURES_remove = "x11 wayland". My mistake was to put this on my image recipe but it must be set on local.conf so all the recipes are aware of this. More info about Qt backends

    2.3 I'm not sure about this but I wanted to remove qtwebkit, and I added (on local.conf): PACKAGECONFIG_remove_pn-qttools = "qtwebkit" PACKAGECONFIG_remove_pn-qtquick1 = "qtwebkit". Still qtwebkit module is built. I need to investigate more about this.

  3. Build the image $ bitbake my_image

  4. Build the SDK $ bitbake my_image -c populate_sdk

Now we got a toolchain needed for cross-compile.