Skip to contentSkip to conversation

EXTRA_OECMAKE options are ignored #sdk #yocto

DISCUSSION Armando Hernandez 2 participants 3 messages Mar 11, 2020 – Mar 16, 2020

lore
Share & tools
lore
#0 lore raw

Hi,

I built an eSDK.
Now I'm using devtool add to create a hello world recipe.
Once the recipe was in place, I added some cmake optoins via EXTRA_OECMAKE in htis way:
EXTRA_OECMAKE += "-DCMAKE_FIND_ROOT_PATH_MODE=BOTH \
-CMAKE_FIND_ROOT_PATH=/home/user/SDK/sysroots/x86_64-pokysdk-linux \
"

Now, the problem is that after running devtool  build test-hello (where test-hello is my recipe as you might have assumed), these variables are overwritten with other values.

How can I successfully pass the correct cmake options via EXTRA_OECMAKE on the recipe?

#1 lore raw
Quoted 7 lines · Armando Hernandez

Hi,

I built an eSDK.
Now I'm using devtool add to create a hello world recipe.
Once the recipe was in place, I added some cmake optoins via EXTRA_OECMAKE in htis way:
EXTRA_OECMAKE += "-DCMAKE_FIND_ROOT_PATH_MODE=BOTH \

Quoted 6 lines

 -CMAKE_FIND_ROOT_PATH=/home/user/SDK/sysroots/x86_64-pokysdk-linux \
                   "

Now, the problem is that after running devtool  build test-hello (where test-hello is my recipe as you might have assumed), these variables are overwritten with other values.

How can I successfully pass the correct cmake options via EXTRA_OECMAKE on the recipe?

please post your recipe

Quoted 3 lines
#2 lore raw
Quoted 2 lines · Khem Raj

please post your recipe

Hello Khem Raj,

Sorry for the late reply. I was not available during last week.
So, I post here my recipe.
But before I want to make two comments:
* I found a variable in the cmake\*.bbclass (i.e. OECMAKE_EXTRA_ROOT_PATH) that I am using in my recipe. Now, that extra root path is not ignored anymore. However, there is an executable that needs to be ran. This executable seems to be not found. The executable is placed under:
/home/ahejuser/SDK/sysroots/x86_64-pokysdk-linux/usr/share/nativesdk-capicxx-core-3.1.12.3/
But there is a link pointing to this file and such soft-link is placed under
/home/ahejuser/SDK/sysroots/x86_64-pokysdk-linux/usr/bin/
That las path is part of my PATH environment variable (i.e. ${PATH}).
* I modified my recipe to include "CMAKE_FIND_ROOT_PATH_MODE_PROGRAM" in my EXTRA_OECMAKE variable (set to BOTH).
I was expecting that with this, the executable could be found, but the build complains that the executable cannot be found:
/bin/sh: 1: commonapi-someip-generator-linux-x86_64: not found
However, if I type in the executable it will be found - as expected since it can be accessed via the PATH environment variable.

I made a small modification to my initial recipe (ou will see the difference between my pasted recipe and my previous post). However the result is the same.

I added " set( CMAKE_FIND_DEBUG_MODE TRUE )" and " set( CMAKE_FIND_DEBUG_MODE FALSE )" before and afer the add_custom_command() call in my CMakeFile.txt but I got not relevant output that helps me to debug this (maybe that CMAKE_FIND_DEUG_MODE is not used properly, but wanted to mentioned it anyways).

So... here my recipe:

LICENSE = "CLOSED"
LIC_FILES_CHKSUM = ""

SRC_URI = "https://github.com/xxxxxxxxx/common-test.git;protocol=https"

PV = "1.0+git${SRCPV}"
SRCREV = "68c6e3b837ef7d8b12d8aec0f4f558c947fac0c"

S = "${WORKDIR}/git"

inherit cmake

EXTRA_OECMAKE = "-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=BOTH" OECMAKE_EXTRA_ROOT_PATH="/home/ahejuser/SDK/sysroots/x86_64-pokysdk-linux"

Again, any hint will be pretty much appreciated.
Thanks in advance!

Armando Hernandez