How to include another recipe inside a recipe

86 Views Asked by At

so i have a recipe A.bb that builds correctly and looks like below

SUMMARY = "A"
DESCRIPTION = "Recipe A"
LICENSE = "CLOSED"    
SRC_URI = "git://gerrit6.labcollab.net:9418/A;protocol=ssh;branch=mainline;name=a;destsuffix=a-git/ \
               file://run-ptest \
               ...
               "
    
    SRCREV_FORMAT = "a"
    SRCREV_a = "xxxyyyzzz"
    S_a = "${WORKDIR}/a-git/"
    
    
    require foo.inc
    ...

Now i need to add another recipe B.bb that could be build individually as well but i need to also include it in A.bb . B.bb looks like below

SUMMARY = "B"
DESCRIPTION = "Recipe B"
LICENSE = "CLOSED"

SRC_URI = "git://git.amazon.com/pkg/B;protocol=ssh;branch=mainline;name=b;destsuffix=a-git/shared/b"
SRCREV_b = "xxxyyyzzz"
S_b = "${WORKDIR}/a-git/shared/b"

inherit cmake foo 

and i am trying to include it in A.bb as follows

require foo.inc 
require B.bb <--- added this line

    ...

But now when i try to build B recipe i get the following error

CMake Error: The source directory "/opt/workspace/b/git-r0/b-git" does not appear to contain CMakeLists.txt even though CMakeLists.txt exists for package B at root of mainline branch. Would be great if someone can tell what i might be missing here. Please note that although i know that you can have inc file and include that in bb files as well but if i understand correctly we cannot build them and i do want the option of building B package individually but also include it inside file structure of A i.e A/shared/B path

0

There are 0 best solutions below