【问题标题】:Yocto include cmake project with custom stepsYocto 包含带有自定义步骤的 cmake 项目
【发布时间】:2021-11-05 03:21:11
【问题描述】:

我正在尝试将这个基于 cmake 的简单项目包含到我的图像中:https://github.com/MatrixOrbital/HTT-Utility

在 Linux 中构建的步骤是:

mkdir build
cd build
cmake ..
make

我正在尝试在我的 Yocto 食谱中重现这些步骤。生成的二进制文件 (./build/htt_util) 应该安装在 /usr/bin 中。

到目前为止,在 devtool 和一些手动调整的帮助下,我最终得到了这个秘诀:

LICENSE = "MIT & Unknown"
LIC_FILES_CHKSUM = "file://LICENSE;md5=ff75ee274f4c77abeee3db089083fec7 \
                    file://hidapi/LICENSE.txt;md5=7c3949a631240cb6c31c50f3eb696077"

SRC_URI = "git://github.com/MatrixOrbital/HTT-Utility.git;protocol=https"
SRC_URI += "file://0001-Adding-ctype.patch;"

PATCHTOOL = "git"

# Modify these as desired
PV = "1.0+git${SRCPV}"
SRCREV = "2045d5eacc67b89a02dafe41edfd032179333aee"

S = "${WORKDIR}/git"

inherit cmake

# Specify any options you want to pass to cmake using EXTRA_OECMAKE:
EXTRA_OECMAKE = ""

DEPENDS += "udev"

我应该在我的配方中添加什么来实现生成二进制文件并安装在 /usr/bin 的目标?

我一直在尝试玩:

do_configure() {
    ...
}

do_compile() {
    ...
}

do_install() {
    ...
}

但到目前为止,我还没有做任何有用的事情。 任何帮助将不胜感激。

【问题讨论】:

    标签: cmake cross-compiling yocto yocto-recipe


    【解决方案1】:
    do_install() {
        install -m 0644 mybinary ${D}${bindir}
    }
    
    FILES_${PN} = " \
        ${bindir} \
    "
    

    【讨论】:

      猜你喜欢
      • 2011-11-28
      • 2019-02-16
      • 2015-01-22
      • 1970-01-01
      • 2018-06-04
      • 1970-01-01
      • 2015-02-18
      • 1970-01-01
      • 2018-11-17
      相关资源
      最近更新 更多