Episode 7: Burkhard on Qt Embedded Systems
Welcome to Episode 7 of my newsletter on Qt Embedded Systems. This newsletter goes out now to over 150 people 🙏
Don't miss out on my webinar on 8 July 2020 about cross-building Qt application from QtCreator using Docker containers (see News below). QtCreator runs on a different Linux verison than the Docker container. This independence comes in quite handy, if you work on multiple projects at the same time or with different versions of a product. I hope to see you in the webinar organised by The Qt Company.
I cover the FOSS North track on FOSS licensing, C++ lambdas, mocks for unit testing, building a Qt SDK with Yocto and more in this newsletter.
Enjoy reading and stay safe - Burkhard 💜
My Blog Posts
Qt Embedded Systems - Part 2: Building a Qt SDK with Yocto.
This is Part 2 in my series on building an Internet radio running on a custom Linux system and a Raspberry Pi. We need a Qt SDK to cross-build the radio application from QtCreator on our development PC, deploy it with SSH to the Pi and run it on the Pi. We build the SDK with the recipe meta-toolchain-qt5. A bit to my surprise, this turned out to be the easy part.
Using the Qt SDK and especially making QtCreator work smoothly with CMake was the tricky part. In theory, QtCreator would pass the toolchain file (contained in the SDK) to CMake and CMake would generate the Makefiles for the cross-build. In reality, you face two problems.
The CMake configuration files of the Qt modules (e.g., Qt5CoreConfig.cmake) return prematurely with an error because of an unset CMake variable OE_QMAKE_PATH_EXTERNAL_HOST_BINS. You fix this error by setting the variable to the correct value in the kit's CMake configuration.
You must then do something counter-intuitive. You leave the sysroot, the compilers, the Qt version and the Qt mkspec empty - in the newly defined kit. This is a slightly backward way to tell QtCreator only to use the toolchain file.
It's easy sailing from then on. You can change your source code and press Ctrl+R in QtCreator. QtCreator will do the rest: cross-build the application binary, kill the application running on the Pi, copy the binary to the Pi and starting the application on the Pi.
CMake Resources.
I collected all my CMake resources on this page. Currently, you find six post reviews from my newsletter and my four own posts on the page. I'll add more posts when I find useful ones.
Watch the parent page Resources for more post collections. A likely next candidate is a collection about using Qt under LGPLv3 and checking embedded Linux systems for FOSS-license compliance.