I am adding my own library from e.g. a local folder (I also have published the library, too). The library itself is GitHub - divStar/ahmsville-dial2-hardware-sensors: AhmsVille Dial 2 Hardware Sensors, which is based on GitHub - divStar/ahmsville-dial2-abstract-sensors: AhmsVille Dial 2 Abstract Sensors. I have added a
main.cpp to the hardware sensors library and it compiles fine (aside of a few warnings here and there due to using
build_flags = -std=gnu++17 and
build_unflags = -std=gnu++11).
This library contains a custom
mpu6050 library in the
lib folder and I have no errors when e.g. looking at HardwareSpaceNavigatorSensorAdapter in the hardware sensors project itself.
But when I import this project using the
platformio.ini file of the actual firmware project, that I am working on, instead of accepting
#include <MPU6050.h> the application expects me to change paths and
#include <../lib/mpu6050-custom/MPU6050.h> would work, but I would like to avoid having to change my library after including it.
How to export the library (
mpu6050-custom), which resides in my
lib folder of the hardware sensors project in such a way, that when including it via
platformio.ini in the actual project where I want to use those hardware sensors, it would find this library just as expected?
Perhaps I should have set something in the
lib_dir or something?
I would like to not have to modify my library after importing just to have it work in my firmware project.
Edit: I checked a couple of suggested topics (e.g. Private library with library.json ignored in libs folder - #5 by yamaan93), but it did not give me a clue on how to solve this issue.