Page 1 of 1

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

Posted: Sat Aug 26, 2023 1:54 pm
by omandine
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?

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

Posted: Tue Oct 15, 2024 12:56 pm
by Orange_Murker
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})