Search code examples
mongodbcmakeyoctorecipeopenembedded

Yocto recipe using cmake cannot find git


I am trying to build a recipe for mongo-cxx-driver (https://github.com/mongodb/mongo-cxx-driver). I have working recipes for libbson and mongo-c-driver, which are requirements, but when I try to build mongo-cxx-driver, it fails when trying to clone a 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!

The recipe:

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}"

If I run:

$ bitbake -c devshell mongo-cxx-driver

and build manually through the devshell, it works just fine.

Any ideas what might be wrong?


Solution

  • You should try to add:

    OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH"
    

    to your recipe after inherit cmake