Adding external library to PX4


For some of the work I am doing, I need to include the ALGLIB library in one of my modules. I do not have a lot of experience with cmake, and am unsure of the proper way to do this. I tried adding the source code to src/lib then adding the directory to the CMakeLists.txt in the src/lib directory, but I am unsure of what the CMakeLists in the library’s directory should look like.

Could anybody please point me in the right direction?

Thank you,

Actually, I was able to get this to work by adding a CMakeLists.txt with px4_add_library(…). However, the library depends on things such as which fails when I compile. Would it be feasible to manually add all of these libraries to PX4?

1 Like