Yocto Recipe for a GTK Application

Say, you have a GTK Application and you want this application to be compiled and installed on the target machine.

hello_gtk.c


To compile on your own machine you run the following command.

$ gcc files/hello_gtk.c -o hello_gtk `pkg-config --cflags --libs gtk+-3.0`


Steps to achieve the same on your Yocto Image:

1. Create a folder named 'gtk-hello' in your own layer : mkdir gtk-hello
2.  Create a recipe named 'gtk-hello_1.0.bb' in the newly created folder with the following contents:

3. Create a folder inside 'gtk-hello'  named files and copy the 'hello_gtk.c' file into it
4. To include this add IMAGE_INSTALL += "gtk-hello" into local.conf or your machine configuration


Comments

Popular posts from this blog

bb.utils.contains yocto

make config vs oldconfig vs defconfig vs menuconfig vs savedefconfig

PR, PN and PV Variable in Yocto