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

6

9

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"

Sizar answered 26/10, 2016 at 9:11 Comment(7)
populate-sdk will generate a script that will install all parts, Qmake, Qt libs and headers for your target architecture.Beaverboard
@Beaverboard So I don't need to do nothing more apart of adding meta-qt5 to bblaers.conf?Sizar
Adding to bblayers.conf make Bitbake able to see all recipes into Qt5 layer. You have to add required packets int your recipe or into local.conf, like: qtbase, qt3d, qtserial, etc... Then add inherit populate_sdk_qt5 to your recipe to make Yocto able to install all components of Qt5 into SDK.Beaverboard
@Beaverboard Would u mind to explain further or point me to some documentation where it's explained? I mean I want to understand what populate_sdk_qt5 does and I want to be able to configure the process. My build failed. I need to disable some features because I don't need X11/Wayland neither qtwebkit. Btw, referring to my 1st point, I discovered that Qt application can be deployed on targets without Qt libs installed on but I can bundle them so for now I won't install qt packages. I only need to get the SDK.Sizar
If your recipe is working (Bitbake can deplay the full recipe) populate SDK extract from the "compiled" recipe all files needed for SDK: cross compiler, cross-linker, libs, interfaces (.h) and so on. So if you want an SDK for your target architecture, with Yocto, you must have a working recipe.Beaverboard
@Beaverboard yes, my image recipe works, I first did successful build bitbake my_image. It fails when I populate_sdkSizar
You should post a new question with error details. BTW populate_sdk recipes needs more packages, like _dev (developement) an some other download that can conflict with something into your recipe.Beaverboard
S
6

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.

Sizar answered 2/11, 2016 at 8:29 Comment(0)
E
3

If you want to add Qt5 to your image-based SDK, you need to add the following line to your image recipe:

inherit populate_sdk_qt5
Effie answered 26/10, 2016 at 11:20 Comment(0)
S
1
  1. If you want default Qt5 SDK use
    bitbake meta-toolchain-qt5 or
  2. If you need Qt5 sdk with extra packages then first compile your qt5 image with required packages after that compile sdk.

    bitbake custom-qt5-image

    bitbake -c do_populate_sdk custom-qt5-image

Slut answered 22/12, 2017 at 5:2 Comment(0)
H
0

You have to add the path of meta-qt5 in your conf/bblayers.conf to the BBLAYERS variable. I think it's all you need to start.

Harwill answered 26/10, 2016 at 9:49 Comment(1)
I already did that. So when I build, bitbake already "knows" that the SDK that I want is from meta-qt5?Sizar
S
0

Use Default Qt5 SDK for default Qt5 packages: Follow this steps in below link Yocto Qt5 Toolchain Installation

Or inherit populate_sdk populate_sdk_qt5 and IMAGE_FEATURES += "other packages" in your-custom-image.bb

bitbake your-custom-image -c populate_sdk
Sheatfish answered 3/6, 2020 at 21:25 Comment(0)
B
0

to remove qtwebkit , you need to adjust this package

meta-qt5/recipes-qt/packagegroups/packagegroup-qt5-toolchain-target.bb


RDEPENDS_${PN}_remove = " \
    qtwebkit-dev \
    qtwebkit-mkspecs \
    qtwebkit-qmlplugins \
"

then


bitbake your-custom-image -c populate_sdk

Bentlee answered 16/9, 2022 at 23:28 Comment(1)
To clarify, don't modify the recipe directly, add a packagegroup-qt5-toolchain-target.bbappend to you own meta layer and add the RDEPENDS_${PN}_remove line.Alphabetical

© 2022 - 2024 — McMap. All rights reserved.