1From 40657a770baadfff30abfecf7638e7b1c340db4d Mon Sep 17 00:00:00 2001 2From: Marek Vasut <marex@denx.de> 3Date: Thu, 14 Mar 2024 03:23:10 +0100 4Subject: [PATCH] fix(cmake): generate versioned shared libraries 5 6Add missing version suffix to shared libraries. Currently the filename of 7generated shared libraries is only liblvgl.so, which prevents coexistence 8of different versions of LVGL on the same system. Set VERSION and SOVERSION 9to make cmake add the version suffix to generated shared libraries. That 10changes the filename to liblvgl.so.9.0.0 and includes symlink with major 11ABI version, i.e. liblvgl.so.9 . 12 13Upstream-Status: Submitted [https://github.com/lvgl/lvgl/pull/5865] 14Signed-off-by: Marek Vasut <marex@denx.de> 15--- 16 env_support/cmake/custom.cmake | 11 +++++++++++ 17 1 file changed, 11 insertions(+) 18 19diff --git a/env_support/cmake/custom.cmake b/env_support/cmake/custom.cmake 20index 9800468eb..6f33f1cc8 100644 21--- a/env_support/cmake/custom.cmake 22+++ b/env_support/cmake/custom.cmake 23@@ -1,3 +1,6 @@ 24+set(LVGL_VERSION "9.0.0") 25+set(LVGL_SOVERSION "9") 26+ 27 # Option to define LV_LVGL_H_INCLUDE_SIMPLE, default: ON 28 option(LV_LVGL_H_INCLUDE_SIMPLE 29 "Use #include \"lvgl.h\" instead of #include \"../../lvgl.h\"" ON) 30@@ -119,6 +122,8 @@ install( 31 set_target_properties( 32 lvgl 33 PROPERTIES OUTPUT_NAME lvgl 34+ VERSION ${LVGL_VERSION} 35+ SOVERSION ${LVGL_SOVERSION} 36 ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" 37 LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" 38 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" 39@@ -137,6 +142,8 @@ if(NOT LV_CONF_BUILD_DISABLE_THORVG_INTERNAL) 40 set_target_properties( 41 lvgl_thorvg 42 PROPERTIES OUTPUT_NAME lvgl_thorvg 43+ VERSION ${LVGL_VERSION} 44+ SOVERSION ${LVGL_SOVERSION} 45 ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" 46 LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" 47 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" 48@@ -155,6 +162,8 @@ if(NOT LV_CONF_BUILD_DISABLE_DEMOS) 49 set_target_properties( 50 lvgl_demos 51 PROPERTIES OUTPUT_NAME lvgl_demos 52+ VERSION ${LVGL_VERSION} 53+ SOVERSION ${LVGL_SOVERSION} 54 ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" 55 LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" 56 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" 57@@ -173,6 +182,8 @@ if(NOT LV_CONF_BUILD_DISABLE_EXAMPLES) 58 set_target_properties( 59 lvgl_examples 60 PROPERTIES OUTPUT_NAME lvgl_examples 61+ VERSION ${LVGL_VERSION} 62+ SOVERSION ${LVGL_SOVERSION} 63 ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" 64 LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" 65 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" 66-- 672.43.0 68 69