Cmake with bitbake recipe

回眸只為那壹抹淺笑 提交于 2019-12-03 06:25:41

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.

If the CMakeLists.txt uses the install command then bitbake will do the install for you and you won't need to define you own do_install.

install(TARGETS cameracapture DESTINATION bin)

add the source directory in your recipe.

example S = "${WORKDIR}/cameracapture

S is the source code path where your CMakeList.txt.

any how your are inheriting the cmake bbclass in your recipe, so it will take care of all configure , compile and install functionalities.

after doing this you can remove you do_configure function in the above recipe also.

you can add your make options if any to the below macro (as you kept empty). example

EXTRA_OECMAKE = "all"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!