From 723f4110760846a63c14fb1e0ba19a896ae63d4e Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Thu, 13 Jun 2024 05:40:30 +0200 Subject: [PATCH] fix(cmake): install headers correctly (#6332) --- env_support/cmake/custom.cmake | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/env_support/cmake/custom.cmake b/env_support/cmake/custom.cmake index ae3a50885..a95362f25 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(