Component: Include header inside main folder

RichPiano
Posts: 123
Joined: Mon May 18, 2020 2:51 pm

Component: Include header inside main folder

Postby RichPiano » Sat May 15, 2021 9:54 am

For a component I want to include a config header that's located under the main folder. How would I do that?

I know that you can specify the REQUIRES and PRIV_REQUIRES fields in CMakeLists.txt to refer to the required components. But main isn't exactly a component or is it? Can I REQUIRE it still?

bitmandu
Posts: 6
Joined: Fri Apr 23, 2021 2:37 pm

Re: Component: Include header inside main folder

Postby bitmandu » Sat May 15, 2021 3:39 pm

I think you want to add "main" to INCLUDE_DIRS in CMakeLists.txt. This should add the main folder to the global include search path.

For example

Code: Select all

idf_component_register(SRCS ...
                       INCLUDE_DIRS "main" ...
                       REQUIRES ...)

Who is online

Users browsing this forum: Majestic-12 [Bot] and 70 guests