PerMalmberg / Smooth

C++ framework for embedded programming on top of Espressif's ESP-IDF.
Apache License 2.0
325 stars 30 forks source link

โ“Can you require smooth from a traditional ESP-IDF component? #164

Closed jsmestad closed 3 years ago

jsmestad commented 3 years ago

I apologize if this is answered somewhere else, I could not find it ๐Ÿ™

I am slowly converting a project over to use Smooth (great work by the way!), and I have a component that I have switched over to using smooth::core::io::Input, but the compiler cannot find the header.

Directory Structure:

components/
|- encoder/
    |- include/
      |- rotary_encoder.hpp
    |- CMakeLists.txt
    |- rotary_encoder.cpp
|- externals/
   |- smooth/..

When I add smooth to the component's REQUIRES definition, it still cannot find the header:

# components/encoder/CMakeLists.txt

idf_component_register(
    SRCS "rotary_encoder.cpp"
    INCLUDE_DIRS "include"
    REQUIRES smooth_component # NOTE: Also tried just `smooth`, `smooth/smooth_component` and those did not work either
)

I can use smooth just fine inside of main so I am probably doing something foolish if you don't mind pointing me in the right direction.

PerMalmberg commented 3 years ago

Smooth is meant to be used as a component. Did you write the #include correctly?

Al the test examples uses smooth as a component iirc.

jsmestad commented 3 years ago

Sorry I meant to be used "in a component" meaning I have a regular esp-idf component in components/ but I cannot have an include (like #include <smooth/....>) from inside the esp-idf component.

If I move the same code that was in the esp-idf component into the main directory, everything works fine.

PerMalmberg commented 3 years ago

Oh like a secondary component dependency? I don't know, I've never tried.

On Sat, 7 Aug 2021, 18:20 Justin Smestad, @.***> wrote:

Sorry I meant to be used "in a component" meaning I have a regular esp-idf component in components/ but I cannot have an include (like #include <smooth/....>) from inside the esp-idf component.

If I move the same code that was in the esp-idf component into the main directory, everything works fine.

โ€” You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PerMalmberg/Smooth/issues/164#issuecomment-894674867, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAU2LLEIJPKM5GZNVGVHIM3T3VMMVANCNFSM5BI5KCUQ .

jsmestad commented 3 years ago

Yep that's probably the right term for it :upside_down_face:

Ah ok, thanks :+1: