The component template generated by `idf.py create_component` seems to cater more to components that are used to structure single projects. E.g. out-of-the-box, the generated component can not even be compiled to an *.a archive for syntax checks, no test structure etc. is created, etc.
The following seems to me to be a common way for components to be structured abd is how I'm setting up our components currently :
Code: Select all
.
├── CMakeLists.txt
├── example
│ ├── CMakeLists.txt
│ ├── main
│ │ ├── CMakeLists.txt
│ │ └── example.c
│ └── sdkconfig
├── include
│ └── my_component.h
├── README.md
└── src
└── my_component.c
- the c implementation files are moved to a `src` directory instead of being in the top-level directory of the component
- I create an `example` (and/or `test`) project which demonstrates usage and from which I compile the component during development
Any thoughts on this? Did I skip an import part of the docs that explained how this should be structured? How is everyone else constructing their components?