How do you add a a non esp_idf component into a project?

I am trying to add a component into a platformio project, how do I do that?
Thanks

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 components in the root of your project. This folder will be automatically scanned for valid components.
  • Using EXTRA_COMPONENT_DIRS option in the root CMakeLists.txt file. This option represents a list of extra directories to search for components.

I write down the process step by step to see where it went wrong. Sorry for the trouble.