fix(cmake): install headers correctly (#6332)

This commit is contained in:
Gabor Kiss-Vamosi
2024-06-13 05:40:30 +02:00
committed by GitHub
parent 0c912bdc2b
commit 723f411076

View File

@@ -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(