0


I use cmake to build my source code. It depend on a package named "spdlog".
I want to generate the sdk using yocto. SDK is correctly generated using populate_sdk but spdlog config cmake file is not shipped in SDK. My receipe :

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

But, we I install my SDK and try to use it to compil my code, it failed with this error :

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

When I check my build tmp/work/spdlog folder, I can see the files exported :

./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

Do you have any idea about this issue ?

craken
  • 1,411
  • 11
  • 16
  • 1
    cmake files belong to `${PN}-dev` package. You can try my answer on a quite different question, but the example recipes and information in answer may help you: https://stackoverflow.com/questions/52063591/how-to-deploy-a-find-cmake-file-for-an-autotools-library-in-the-correct-place-f/52079576#52079576 BTW you can check content of final package with `oe-pkgdata-util`, see https://stackoverflow.com/questions/42258323/how-to-find-which-yocto-project-recipe-populates-a-particular-file-on-an-image-r/42293849#42293849 – Tomas Novotny Jan 18 '19 at 15:00
  • Yes thanks. That's it. – craken Jan 18 '19 at 15:05

1 Answers1

0

Every package from FILES_${PN}-dev will be available in Yocto SDK.

The solution for my issue is to set cmake required config file *.cmake under FILES_${PN}-dev.

craken
  • 1,411
  • 11
  • 16