0

I have created an external component in ESP which is for my common code, and therefore I do not want to put it in the components folder of my main project. Doing this I have a problem in the external component whereby it cannot find any standard library at all. My main project has no problem.

Is there a way of forcing my external component to find the standard library includes?

In my main project CMakeLists.txt I have included - list(APPEND EXTRA_COMPONENT_DIRS "../custom_external_component"), which builds find but the IDE still cannot find the includes in the component. Do I need to add anything specific to my CMakeLists.txt file in my external component?

Project layout:

  • MainProject
    • CMakeLists.txt
    • Main
      • Some source files
      • CMakeLists.txt
  • ExternalComponent
    • Code
    • CMakeLists.txt

External Component CMakeList.txt:

set(SOURCES
  "Code/Src/file1.c")

idf_component_register(SRCS "${SOURCES}"
                   INCLUDE_DIRS "Code/Inc" 
                   REQUIRES "main" "bt")

Any help is appreciated!

Joe
  • 37
  • 8

0 Answers0