Arduino as a component with idf as lib
Posted: Thu Dec 01, 2022 3:26 pm
Hi all,
I have a large, quite complex codebase for the ESP32 that is based on Arduino and I'm trying to migrate away from platformio since it doesn't allow the flexibility that I need.
I have setup the project as a regular cmake project with the idf as a lib (following the general concepts here: https://github.com/espressif/esp-idf/tr ... idf_as_lib. I would ideally like to do it this way as, again, it lets me control
I have now got to the part where I need to include Arduino as a component, following the instructions here: https://docs.espressif.com/projects/ard ... onent.html. The issue is that the CMakeLists.txt in the Arduino component expects to be called from a registered component directory:
I think I have two options, either re-write the Arduino CMakeLists.txt and have to maintain it (a bit annoying) or, try to make the Arduino CMakeLists.txt think that everything is fine and pass everything required into it while still just using the rest as vanilla CMake. I think the second option is a bit easier though, does anyone have any resources that can explain how to do this?
Thanks in advance
I have a large, quite complex codebase for the ESP32 that is based on Arduino and I'm trying to migrate away from platformio since it doesn't allow the flexibility that I need.
I have setup the project as a regular cmake project with the idf as a lib (following the general concepts here: https://github.com/espressif/esp-idf/tr ... idf_as_lib. I would ideally like to do it this way as, again, it lets me control
I have now got to the part where I need to include Arduino as a component, following the instructions here: https://docs.espressif.com/projects/ard ... onent.html. The issue is that the CMakeLists.txt in the Arduino component expects to be called from a registered component directory:
Code: Select all
CMake Error at /home/user/esp/esp-idf/tools/cmake/component.cmake:431 (message):
Called idf_component_register from a non-component directory.
Call Stack (most recent call first):
components/arduino/CMakeLists.txt:211 (idf_component_register)
Thanks in advance