How to do it...

The Yocto build system also contains classes with the required knowledge to build CMake packages. All your recipe needs to do is inherit the cmake class and configure the arguments to be passed to the configure script in the EXTRA_OECMAKE variable. Usually, the CMake system understands how to install the software, so you do not need a do_install override. A recipe to build the helloworld.c example application, meta-custom/recipes-example/helloworld-cmake/helloworld-cmake_1.0.bb, follows:

DESCRIPTION = "Simple helloworld cmake application" 
SECTION = "examples" 
LICENSE = "MIT" 
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" 
 
SRC_URI = "file://CMakeLists.txt   
           file://helloworld.c" 
 
S = "${WORKDIR}" 
 
inherit cmake 
 
EXTRA_OECMAKE = "" 

If extra configuration options need to be passed to cmake, the EXTRA_OECMAKE and PACKAGECONFIG_CONFARGS variables can be used.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset