I use similar following code structure for my project:
- components/ - component1/ - CMakeLists.txt
- component2/ - CMakeLists.txt
- inc/ - component2.h
- main/ - src3.c
It is similar to the one described in the ESP official build-system guide. The question is: if src2.c above includes component2.h, how to include 'inc' directory in CMakeLists.txt of component2 ? Without 'inc' directory being set properly, the compiler would fail to find component2.h in order to compile the src2.c. Otherwise, I have to put component2.h in the same directory as src2.c file.
The COMPONENT_ADD_INCLUDEDDIRS only applies to source files under main directory but component source files.
Thanks in advance,