domotic/main/CMakeLists.txt
2025-05-18 09:38:00 +02:00

41 lines
1.8 KiB
CMake

set(EXTRA_COMPONENT_DIRS ../components)
set(comps heap nvs_flash meteofrance esp_netif image_downloader fatfs protocol_examples_common mqtt )
if(${IDF_TARGET} STREQUAL "esp32p4")
list(APPEND comps bsp_extra esp32_p4_function_ev_board sdmmc vfs littlefs wifi_logger app_update esp_https_ota espcoredump esp_http_server esp_wifi)
endif()
function (make_font fontSize)
execute_process(COMMAND podman run -v /home/marc/rgb_lcd/main/fonts:/app -w /app lvfontconv lv_font_conv --bpp 4 --size ${fontSize} --no-compress --font Montserrat-Medium.ttf --symbols "0123456789.°éèûCABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz %,'():" --format lvgl -o montserrat_medium_${fontSize}.c --font fa-solid-900.ttf --range 61461,0xf0c2,0xf575)
endfunction()
make_font(12)
make_font(18)
make_font(24)
idf_component_register(SRC_DIRS . fonts
INCLUDE_DIRS "."
REQUIRES ${comps}
EMBED_TXTFILES ${project_dir}/main/ca_cert.pem
EMBED_FILES "index.html")
set_source_files_properties(
PROPERTIES COMPILE_OPTIONS
"-DLV_LVGL_H_INCLUDE_SIMPLE;-Wno-format;-DLV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(montserrat_medium_12) LV_FONT_DECLARE(montserrat_medium_18) LV_FONT_DECLARE(montserrat_medium_24)"
)
if(${IDF_TARGET} STREQUAL "esp32p4")
lvgl_port_create_c_image("images/wifi_ok.png" "images/" "ARGB8888" "NONE")
lvgl_port_create_c_image("images/wifi_ko.png" "images/" "ARGB8888" "NONE")
lvgl_port_create_c_image("images/mqtt_ok.png" "images/" "AUTO" "NONE")
lvgl_port_create_c_image("images/mqtt_ko.png" "images/" "ARGB8888" "NONE")
lvgl_port_add_images(${COMPONENT_LIB} "images/")
littlefs_create_partition_image(littlefs images_meteo FLASH_IN_PROJECT)
endif()