我使用cmake构建我的源代码。它取决于名为“ spdlog”的软件包。
我想使用yocto生成SDK。使用populate_sdk正确生成了SDK,但SDK中未附带spdlog配置cmake文件。
我的收据:
SUMMARY = "Spdlog"
DESCRIPTION = "Fast C++ logging library"
AUTHOR = "author name"
LICENSE = "CLOSED"
SECTION = "libs"
SRC_URI = "git://git@github.com/gabime/spdlog.git;branch=master;protocol=ssh"
SRCREV = "7088644d3f69f18b51671eb52dd49028fd858add"
PR = "r0"
PVBASE := "${PV}"
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PVBASE}:"
PV = "${PVBASE}.${SRCPV}"
S = "${WORKDIR}/git"
inherit cmake pkgconfig
FILES_${PN} += "/usr/lib/cmake/spdlog/spdlogConfig.cmake \
/usr/lib/cmake/spdlog/spdlogConfigVersion.cmake \
"
但是,我们安装了我的SDK并尝试使用它来编译我的代码,但此错误失败:
Make Error at CMakeLists.txt:89 (find_package):
Could not find a package configuration file provided by "spdlog" with any
of the following names:
spdlogConfig.cmake
spdlogConfigVersion.cmake
当我检查build tmp / work / spdlog文件夹时,可以看到导出的文件:
./image/usr/lib/cmake/spdlog/spdlogConfig.cmake
./sysroot-destdir/usr/lib/cmake/spdlog/spdlogConfig.cmake
./packages-split/spdlog/usr/lib/cmake/spdlog/spdlogConfig.cmake
./build/CMakeFiles/Export/lib/cmake/spdlog/spdlogConfig.cmake
./build/spdlogConfig.cmake
./package/usr/lib/cmake/spdlog/spdlogConfig.cmake
./recipe-sysroot-native/usr/share/cmake-3.8/Modules/FindPkgConfig.cmake
./recipe-sysroot-native/usr/share/cmake-3.8/Modules/UsePkgConfig.cmake
您对此问题有任何想法吗?
答案 0 :(得分:0)
Yocto SDK中将提供FILES _ $ {PN} -dev中的每个软件包。
解决此问题的方法是在FILES _ $ {PN} -dev下设置cmake所需的配置文件* .cmake。