I guess you’re asking about adding thirdparty or custom esp-idf components to your project. Then the answer was already given to you by maxgerhard here by this link.
ESP-IDF modules as modular pieces of standalone code might be useful for structuring reusable code or including third party components that aren’t part of ESP-IDF.
…
- By adding a new component to an optional folder called
componentsin the root of your project. This folder will be automatically scanned for valid components.- Using
EXTRA_COMPONENT_DIRSoption in the rootCMakeLists.txtfile. This option represents a list of extra directories to search for components.