C++ / cmake library compilation in Mangoh Red

Hello all,

I have a large library providing a number of specific functions related to accessing a drone autopilot. The project is fully written in C++, and configured around cmake. The goal is to create a library that should be later on linked with further code.

I’ve been looking around for a long time about the way to compile that code but got nothing clear from the forum.

I would greatly appreciate any insight on this issue. I will provide more details if anyone seems to have knowledge of this.

Keep safe,
Enric

Have you tried to use the toolchain to cross compile your code?

Here shows how to compile cpp project in legato application:

In the past, I used to cross compile the Azure IOT C SDK which is also using CMAKE, I need to set the CMAKE_C_COMPILER to point to the toolchain:
/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc

Thanks for the links.
I will take a look and see if they work for me. The main problem I have is that the project contains a few folders and a few hundred cpp source files and associated headers. The framework seems to require specifying the cpp files one by one.

Regarding the variables in CMAKE, I understand that I need to specify, in addition to the computer, the linker and the paths to libraries, etc.
We are using leaf, do you know if those paths are recorded in any of the shell variables?

Regards

I suggest you compiling your code with toolchain first.
i.e. don’t include anything related to leaf and legato.

You can find the toolchain here:
/home/owner/LEAF/leaf-data/current/wp77-toolchain/

1 Like