[yocto] CMake module integration

Kasper Revsbech krevsbech at gmail.com
Tue Apr 25 01:30:20 PDT 2017


Hi
I am trying to include CPPCheck into Yocto to be used by CMake as a Cmake
Module.
Hence when building my application recipes that are based on using CMake
build as build system, CPPCheck is performed.

What I currently did, was:
Making a recipe for CPPCheck to be used in the toolchain by:
BBCLASSEXTEND = "native"
This recipe is
1) providing CPPCheck in the native toolchain,
2) deploying a custom CMake module to allow the use of CPPCheck from CMake.
These modules are placed in the native sysroot:
sysroots/x86_64-linux/usr/share/cmake/Modules

When reading the  cmake.bbclass (TAG: morty) i see that the module path is
set to:
--
# Use native cmake modules

list(APPEND CMAKE_MODULE_PATH "${STAGING_DATADIR}/cmake/Modules/")
--
However, when running CMake on a recipe the ${STAGING_DATADIR} is the
target sysroot not the native sysroot.

So the question is, if I am doing it wrong and should provide my
CMakeModules in another way, and if yes how?
Or if this is a bug and the STAGING_DATADIR should be the native sysroot
and not the target sysroot?, hence:
list(APPEND CMAKE_MODULE_PATH "${STAGING_DATADIR_NATIVE}/cmake/Modules/"

Br
Kasper Revsbech
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20170425/7934268a/attachment.html>


More information about the yocto mailing list