How to pass cmake runtime parameter in yocto

anikhan picture anikhan · Oct 13, 2016 · Viewed 6.9k times · Source

I am working on yocto, I have a component which I am compiling manually using cmake command. I need to select some options using cmake while compiling. cmake -Dex=on ..., which enables "ex"

Now I am trying to do the same in the yocto, for compilation I used inherit cmake in bb file, but I am not to pass this option -Dex=on

My bb file looks like this

SECTION = "devel"

LICENSE = "CLOSED" SRC_URI = "file://*"

SRC_URI = "gitsm://****.git;protocol=ssh"

SRCREV="${AUTOREV}"

S = "${WORKDIR}/git"

inherit cmake

How can pass cmake options in the bitbake file?

Answer

Fl0v0 picture Fl0v0 · Oct 13, 2016

You define the extra symbol by setting

EXTRA_OECMAKE += "-Dex=on"

when you have inherit cmake in your recipe.

The variable is used by the cmake.bbclass when cmake is called.