Yocto recipe compiling Qt apps with cmake

Compiling Qt apps with qmake using Yocto if really straight forward.

The following example is based on poky/warrior and my small bit counting tool:

Doing the same using CMake, one may think inheriting cmake instead of qmake5 should be enough.

Unfortunately, this is not true and leads to the error message:

The reason for this is that the qmake5 recipe is doing some more stuff:

  • First, the variable OE_QMAKE_PATH_EXTERNAL_HOST_BINS  is defined by qmake5_paths, so if we want to make use of this variable, we have the inherit qmake5_paths, too.
  • Second, qmake5 depends on qtbase-native, providing the qmake tools we need, so we have to make sure we depend on the native package.
  • Third, we have to make sure CMake is infirmed about the OE_QMAKE_PATH_EXTERNAL_HOST_BINS variable by setting it explicitly using EXTRA_OECMAKE.

So, the complete CMake based recipe will look like:


The following two tabs change content below.

Mike Bergmann

Technical software developer loving low level, bit peeking, embedded development as well as GUI, OO, and X-platform development.

Have your say