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

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.