Search code examples
cmakeopenembeddedbitbake

Cmake with bitbake recipe


I am trying to build an yocto image with my own package. I have OpenCV code on github which uses cmake.

I trying to write a recipe for it and facing lot of errors. Can any one give some hints on what functions or parameters to include in my recipe. My recipe looks as following

DESCRIPTION = "cameracapture application" 
SECTION = "examples" 
LICENSE = "CLOSED" 
PR = "r0" 

DEPENDS += "opencv"

SRC_URI = "git://https://github.com/zafrullahsyed/cameracapture.git;protocol=https;tag=v0.1"

EXTRA_OECMAKE=""

do_configure() { 
 cmake ../ 
} 

inherit pkgconfig cmake

I followed these tutorials to write my recipe with cmake but in vain: Bitbake Player recipe

Cmake-Bitbake-QT


Solution

  • The correct way of writing own recipes with cmake as follows:

    DESCRIPTION = "cameracapture application" 
    SECTION = "examples" 
    LICENSE = "CLOSED" 
    PR = "r0" 
    
    DEPENDS = "opencv"
    
    SRC_URI = "git://github.com/zafrullahsyed/cameracapture.git;protocol=https;tag=v0.1"
    
    S = "${WORKDIR}/git"
    
    inherit pkgconfig cmake
    
    do_install() {
        install -d ${D}${bindir}
        install -m 0755 cameracapture ${D}${bindir}
    }
    

    Previously I didn't add do_install that's the reason yocto downloads the recipe but unable to include it Image.