Here we use a simple cpp source file to test c++11 and pthread.
Then prepare your CMakeLists.txt:
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
Notice : install should be added into your CMakeLists.txt if you want your binary to be installed into rootfs.
SUMMARY = "cmake example"
There is no need to override do_install nor do_config in this scenario. cmake.bbclass has already defined those tasks and we can just inherit from it.
If pkgconfig is required by your cmake, use inherit pkgconfig cmake instead.
Then add your packages into your layer, don’t forget config your package as IMAGE_INSTALL_append in layer.conf. After that, you should have a folder tree like this:
$ bitbake cmakeexample
Of course don’t forget to re-build your image.
$ bitbake fsl-image-qt5-validation-imx