Skip to content

[question] Yocto SDK together with conan2? #17755

Open
@mickeyproc

Description

@mickeyproc

What is your question?

Hi! I have a question regarding Yocto together with Conan2.
I know you have an integration wiki for conan v1 when it comes to Yocto, but i cannot figure out how to get it to work with conan v2.

I've build a Yocto SDK (Scarthgap release) that I install on my linux machine (Ubuntu 24.04). I then use conan2 to get thirdparty packages (Boost 1.86.0 and OpenCV 4.10.0) to build applications together with the SDK for my arm64 target (imx8).

The conanfile.py is very simple:

from conan import ConanFile
from conan.tools.cmake import cmake_layout

class ExampleRecipe(ConanFile):
    settings = "os", "compiler", "build_type", "arch"
    generators = "CMakeDeps", "CMakeToolchain"

    def requirements(self):
        self.requires("opencv/4.10.0")
        self.requires("boost/1.86.0")

    def layout(self):
        cmake_layout(self)

And my profile called yocto:

[settings]
os=Linux
arch=armv8
compiler=gcc
compiler.version=11
compiler.libcxx=libstdc++11
build_type=Release

[buildenv]
SYSROOT=/home/mic/mysdk/1.0.0/sysroots/cortexa53-crypto-hw-linux

And then i try do install packages with conan:

#!/bin/bash
source /home/mic/mysdk/1.0.0/environment-setup-aarch64-poky-linux
python3 -m venv py-dev-env
source ./py-dev-env/bin/activate
pip3 install -r requirements.txt # Just conan

# conan stuff
CONAN_HOME=$(pwd)/.conan2
export CONAN_HOME
conan profile detect --force

# Need some conan pkg/system packages
PKG_CONFIG_PATH="/usr/lib/x86_64-linux-gnu/pkgconfig/:/usr/share/pkgconfig/:${PKG_CONFIG_PATH}"
export PKG_CONFIG_PATH
mkdir -p build && cd build
conan install .. --build=missing  --profile=yocto

Am i missing something in the conan profile?
I am happy to contribute to the wiki when i got it working.

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide

UPDATE:
I can see there is already some pages in this area at #7285 and #14343
But i am still unable to build with yocto SDK. I feel like it something pretty small that i just haven't figured out.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions