
idf_build_get_property(project_dir PROJECT_DIR)
idf_component_register(
    SRC_DIRS
        "."
    INCLUDE_DIRS
        "."
        ${LV_DEMO_DIR}
    )

set_source_files_properties(
    ${LV_DEMOS_SOURCES}
    PROPERTIES COMPILE_OPTIONS
    "-DLV_LVGL_H_INCLUDE_SIMPLE;-Wno-format;"
    )
    idf_component_get_property(lvgl_lib lvgl__lvgl COMPONENT_LIB)
    idf_component_get_property(freetype_lib espressif__freetype COMPONENT_LIB)
    cmake_policy(SET CMP0079 NEW)
    target_link_libraries(${lvgl_lib} PUBLIC ${freetype_lib})

    spiffs_create_partition_assets(assets ../spiffs_assets FLASH_IN_PROJECT)
    spiffs_create_partition_image(storage ../spiffs FLASH_IN_PROJECT)

    target_link_libraries(${COMPONENT_LIB} INTERFACE
    "${CMAKE_CURRENT_LIST_DIR}"
    "${CMAKE_CURRENT_LIST_DIR}"
    "${CMAKE_CURRENT_LIST_DIR}")
   # spiffs_create_partition_assets(my_spiffs_partition my_folder FLASH_IN_PROJECT)

# idf_component_get_property(lvgl_lib lvgl__lvgl COMPONENT_LIB)
# target_compile_options(${lvgl_lib} PRIVATE -Wno-format)

# set(SPIFFS_DIR "${CMAKE_BINARY_DIR}/spiffs_assets")
# file(MAKE_DIRECTORY ${SPIFFS_DIR})
# file(DOWNLOAD ${URL} ${SPIFFS_DIR}/${FILE} SHOW_PROGRESS)



