How can lvgl and freetype components added with IDF component manager work together?

omandine
Posts: 2
Joined: Tue Apr 04, 2023 11:29 am

How can lvgl and freetype components added with IDF component manager work together?

Postby omandine » Sat Aug 26, 2023 1:54 pm

Environment:
  • IDF 5.0.2
  • idf_components.yml

    Code: Select all

    dependencies:
      espressif/freetype: "*"
      lvgl/lvgl: "~8.2.0"
    
LVGL Configuration: -- to set LV_USE_FREETYPE
  • idf.py menuconfig to select FreeType library in menu Component config -> LVGL Configuration -> 3rd Party Libraries
Compilation result: -- lvgl cannot found ft2build.h
  • managed_components/lvgl__lvgl/src/extra/libs/freetype/lv_freetype.c:12:10: fatal error: ft2build.h: No such file or directory
    12 | #include "ft2build.h"
Question: Could someone tell me how to solve the issue? What I forgot to do or what I misunderstood with managed components?

Orange_Murker
Posts: 1
Joined: Tue Oct 15, 2024 12:51 pm

Re: How can lvgl and freetype components added with IDF component manager work together?

Postby Orange_Murker » Tue Oct 15, 2024 12:56 pm

Hi. To do that you can link FreeType to LVGL in your CMakeLists.txt like so:

Code: Select all

idf_component_get_property(lvgl_lib lvgl__lvgl COMPONENT_LIB)
idf_component_get_property(freetype_lib espressif__freetype COMPONENT_LIB)
target_link_libraries(${lvgl_lib} PUBLIC ${freetype_lib})

Who is online

Users browsing this forum: jsmith56x and 112 guests