Mongodb 使用cmake的Yocto配方找不到git

Mongodb 使用cmake的Yocto配方找不到git,mongodb,cmake,yocto,recipe,openembedded,Mongodb,Cmake,Yocto,Recipe,Openembedded,我正在尝试为mongo cxx驱动程序()构建一个配方。我有libbson和mongo-c-driver的工作方法,这是必需的,但是当我尝试构建mongo-cxx驱动程序时,它在尝试克隆git repo时失败了 $ bitbake mongo-cxx-driver | CMake Error at /home/hme/projects/platform/yocto/poky/build/tmp/work/core2-64-poky-linux/mongo-cxx-driver/3.1.3-r

我正在尝试为mongo cxx驱动程序()构建一个配方。我有libbson和mongo-c-driver的工作方法,这是必需的,但是当我尝试构建mongo-cxx驱动程序时,它在尝试克隆git repo时失败了

$ bitbake mongo-cxx-driver

| CMake Error at 
/home/hme/projects/platform/yocto/poky/build/tmp/work/core2-64-poky-linux/mongo-cxx-driver/3.1.3-r0/recipe-sysroot-native/usr/share/cmake-3.8/Modules/ExternalProject.cmake:1805 (message):
|   error: could not find git for clone of EP_mnmlstc_core
| Call Stack (most recent call first):
|   /home/hme/projects/platform/yocto/poky/build/tmp/work/core2-64-poky-linux/mongo-cxx-driver/3.1.3-r0/recipe-sysroot-native/usr/share/cmake-3.8/Modules/ExternalProject.cmake:2560 (_ep_add_download_command)
|   src/bsoncxx/third_party/CMakeLists.txt:19 (ExternalProject_Add)
| 
| 
| -- Configuring incomplete, errors occurred!
配方:

DESCRIPTION = "MongoDB C++ driver"
SECTION = "libs"
HOMEPAGE = "https://github.com/mongodb/mongo-cxx-driver"
LICENSE = "Apache-2.0"
DEPENDS = "libbson mongo-c-driver git-native"

inherit cmake pkgconfig

SRC_URI = "https://github.com/mongodb/mongo-cxx-driver/archive/r${PV}.tar.gz"

SRC_URI[md5sum] = "fd1ff0f9b2122225e3b402c2bae30427"
SRC_URI[sha256sum] = "cb1b371eb34e991b8bfac65146f862cd379aa8f7270c430e5f3d71d843245ed9"

LIC_FILES_CHKSUM = "file://LICENSE;md5=d2794c0df5b907fdace235a619d80314"

S = "${WORKDIR}/mongo-cxx-driver-r${PV}"
如果我跑步:

$ bitbake -c devshell mongo-cxx-driver
并通过devshell手动构建,效果很好

有什么问题吗?

您应该尝试添加:

OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH"

对于您的配方之后的继承cmake

包,git native可能已在变量中列出。如果是这样,您必须将其作为依赖项添加到配方中。

在配置过程中找不到git可能是您最终不应该解决的问题:配方在配置过程中不应下载任何内容。您应该在获取期间克隆所需的git repo(可能只是将它们添加到SRC_URI中),并了解如何在配置期间告诉构建系统下载的源的位置。或者,找出是否可以告诉构建系统使用外部(系统)组件,并打包其他项目separately@NayfeOECMAKE_FIND_ROOT_PATH_MODE_PROGRAM=“BOTH”做什么?它允许cmake在主机sysroot中搜索程序,而不是仅在目标sysroot中搜索程序