diff --git a/env_support/cmake/custom.cmake b/env_support/cmake/custom.cmake index ae3a508851..a95362f253 100644 --- a/env_support/cmake/custom.cmake +++ b/env_support/cmake/custom.cmake @@ -79,9 +79,15 @@ if(NOT LV_CONF_BUILD_DISABLE_DEMOS) target_link_libraries(lvgl_demos PUBLIC lvgl) endif() -# Lbrary and headers can be installed to system using make install -file(GLOB LVGL_PUBLIC_HEADERS "${CMAKE_SOURCE_DIR}/lv_conf.h" - "${CMAKE_SOURCE_DIR}/lvgl.h") +# Library and headers can be installed to system using make install +file(GLOB LVGL_PUBLIC_HEADERS + "${LVGL_ROOT_DIR}/lvgl.h" + "${LVGL_ROOT_DIR}/lv_version.h") + +if(NOT LV_CONF_SKIP) + list(APPEND LVGL_PUBLIC_HEADERS + "${CMAKE_SOURCE_DIR}/lv_conf.h") +endif() if("${LIB_INSTALL_DIR}" STREQUAL "") set(LIB_INSTALL_DIR "lib") @@ -100,6 +106,12 @@ install( FILES_MATCHING PATTERN "*.h") +# Install headers from the LVGL_PUBLIC_HEADERS variable +install( + FILES ${LVGL_PUBLIC_HEADERS} + DESTINATION "${CMAKE_INSTALL_PREFIX}/${INC_INSTALL_DIR}/" +) + # install example headers if(NOT LV_CONF_BUILD_DISABLE_EXAMPLES) install(