I have a library with many files that needs to be include. There are folders inside a main folder.
Now, I know that with custom components one can do this but not sure how to do this when I have multiple files spread across in many folders.
Is there some examples to show this scenario?
Managing library includes in esp-idf components
-
MicroController
- Posts: 2669
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: Managing library includes in esp-idf components
https://docs.espressif.com/projects/esp ... ists-files
You create a directory for your component/library with all the sources and header files in it. In that component directory you also create a component CMakeLists.txt file with a call to idf_component_register(...) in it.
In the arguments to idf_component_register() you specify the source files to be compiled (SRCS), any/all include directories where component-internal header files are located (PRIV_INCLUDE_DIRS), and any/all directories where the header files reside which other components should be able to include/use (INCLUDE_DIRS).
You create a directory for your component/library with all the sources and header files in it. In that component directory you also create a component CMakeLists.txt file with a call to idf_component_register(...) in it.
In the arguments to idf_component_register() you specify the source files to be compiled (SRCS), any/all include directories where component-internal header files are located (PRIV_INCLUDE_DIRS), and any/all directories where the header files reside which other components should be able to include/use (INCLUDE_DIRS).
Who is online
Users browsing this forum: Amazon [Bot], Bytespider and 6 guests