Tactility/libs/esp_lvgl_port/CMakeLists.txt
Ken Van Hoeylandt 62d30e8b7b
Revert to LVGL 9.0.0 (#64)
* Revert "Update ESP LCD Touch dependencies (#63)"

This reverts commit cbd0355cec25e9d0f83f328ac2cae78e0e3b83e3.

* Revert "Updated board configs for LVGL changes (#62)"

This reverts commit 52d769854f6805407f7ee08adaa78b3a406fa13e.

* Revert "Various updates (#60)"

This reverts commit a8a664703b131963222d2035a3a85ecede29e633.
2024-10-28 23:08:24 +01:00

66 lines
2.3 KiB
CMake

#Get LVGL version
#idf_component_get_property(lvgl_ver lvgl__lvgl COMPONENT_VERSION)
#if(lvgl_ver EQUAL "")
# idf_component_get_property(lvgl_ver lvgl COMPONENT_VERSION)
#endif()
set(lvgl_ver "9.0.0")
message(STATUS "LVGL version: ${lvgl_ver}")
#Select folder by LVGL version
if(lvgl_ver VERSION_LESS "9.0.0")
message(VERBOSE "Compiling esp_lvgl_port for LVGL8")
set(PORT_FOLDER "lvgl8")
else()
message(VERBOSE "Compiling esp_lvgl_port for LVGL9")
set(PORT_FOLDER "lvgl9")
endif()
set(PORT_PATH "src/${PORT_FOLDER}")
idf_component_register(SRCS "${PORT_PATH}/esp_lvgl_port.c" "${PORT_PATH}/esp_lvgl_port_disp.c" INCLUDE_DIRS "include" REQUIRES "esp_lcd" "lvgl" PRIV_REQUIRES "esp_timer")
set(ADD_SRCS "")
set(ADD_LIBS "")
idf_build_get_property(build_components BUILD_COMPONENTS)
if("espressif__button" IN_LIST build_components)
list(APPEND ADD_SRCS "${PORT_PATH}/esp_lvgl_port_button.c")
list(APPEND ADD_LIBS idf::espressif__button)
endif()
if("button" IN_LIST build_components)
list(APPEND ADD_SRCS "${PORT_PATH}/esp_lvgl_port_button.c")
list(APPEND ADD_LIBS idf::button)
endif()
if("espressif__esp_lcd_touch" IN_LIST build_components)
list(APPEND ADD_SRCS "${PORT_PATH}/esp_lvgl_port_touch.c")
list(APPEND ADD_LIBS idf::espressif__esp_lcd_touch)
endif()
if("esp_lcd_touch" IN_LIST build_components)
list(APPEND ADD_SRCS "${PORT_PATH}/esp_lvgl_port_touch.c")
list(APPEND ADD_LIBS idf::esp_lcd_touch)
endif()
if("espressif__knob" IN_LIST build_components)
list(APPEND ADD_SRCS "${PORT_PATH}/esp_lvgl_port_knob.c")
list(APPEND ADD_LIBS idf::espressif__knob)
endif()
if("knob" IN_LIST build_components)
list(APPEND ADD_SRCS "${PORT_PATH}/esp_lvgl_port_knob.c")
list(APPEND ADD_LIBS idf::knob)
endif()
if("espressif__usb_host_hid" IN_LIST build_components)
list(APPEND ADD_SRCS "${PORT_PATH}/esp_lvgl_port_usbhid.c" "images/${PORT_FOLDER}/img_cursor.c")
list(APPEND ADD_LIBS idf::espressif__usb_host_hid)
endif()
if("usb_host_hid" IN_LIST build_components)
list(APPEND ADD_SRCS "${PORT_PATH}/esp_lvgl_port_usbhid.c" "images/${PORT_FOLDER}/img_cursor.c")
list(APPEND ADD_LIBS idf::usb_host_hid)
endif()
if(ADD_SRCS)
target_sources(${COMPONENT_LIB} PRIVATE ${ADD_SRCS})
endif()
if(ADD_LIBS)
target_link_libraries(${COMPONENT_LIB} PRIVATE ${ADD_LIBS})
endif()