Bitbake从当地来源创建cmake配方



我正试图用cmake配方构建一个helloworld包示例。我的问题是bitbake给我一个错误,因为它在/tmp/work/core2-64-poky-linux/helloworld/0.1-r0文件夹中找不到CMakeLists.txt。

错误:

helloworld-0.1-r0 do_configure: Execution of '/path-to-tmp/tmp/work/core2-64-poky-linux/helloworld/0.1-r0/temp/run.do_configure.28001' failed with exit code 1:
CMake Error: The source directory "/path-to-tmp/tmp/work/core2-64-poky-linux/helloworld/0.1-r0/files" does not appear to contain CMakeLists.txt.

我的包在我的层meta mylayer/食谱核心/helloworld:

meta-mylayer/
├── conf
│   └── layer.conf
├── COPYING.MIT
├── README
└── recipes-core
└── helloworld
   ├── files
   │   ├── CMakeLists.txt
   │   └── main_helloworld.c
   └── helloworld_0.1.bb

我的CMakeLists.txt:

cmake_minimum_required(VERSION 2.4)
project(helloworld)
file(GLOB_RECURSE files/*.c)
add_executable(app ${src_files})
install(TARGETS helloworld DESTINATION bin)

我的你好世界_0.1.bb:

PN="helloworld"
PV="0.1"
P="${PN}-${PV}"
DESCRIPTION="This is my package helloworld"
LICENSE="CLOSED"
FILESEXTRAPATHS_prepend:="${THISDIR}/${PN}:"
RDEPENDS_${PN}+=""
DEPENDS+=""
DEPENDS+="cmake"
SRC_URI+="file://CMakeLists.txt file://main_helloworld.c"
S="${WORKDIR}/files"
inherit pkgconfig cmake

我在tmp/tmp/work/core2-64-poky-linux/helloworld/0.1-r0/*的/path中找不到我的文件

为什么不复制文件?我在用尤克托·邓费尔。

谢谢你的帮助。

当您在SRC_URI中有文件时,它们将安装在${WORKDIR}中。

下面的配方就可以了:

DESCRIPTION="This is my package helloworld"
LICENSE="CLOSED"
SRC_URI+="file://CMakeLists.txt file://main_helloworld.c"
S="${WORKDIR}"
inherit pkgconfig cmake

此外,您的CMakeLists.txt不应该在files目录中找到文件。

S被设置为${WORKDIR},因为默认情况下file://回迁器中的文件就放在这里。

DEPENDS已经从您继承的cmake bbclass中拥有cmake本机。您不需要依赖cmake,因为您依赖于cmake本机(您需要在构建时执行cmake;您不需要cmake头或源(。

添加的FILESEXTRAPATHS在默认情况下已经由bitbake使用(它也与您的目录布局不匹配(。

PNPV是从bb配方的文件名中获得的,无需再次设置。

最新更新