From bf96ced12db4d3ebb670cc3a7952a577b8e5fe5f Mon Sep 17 00:00:00 2001 From: Vyacheslav Yurkov Date: Mon, 15 Jun 2026 05:58:04 +0000 Subject: [PATCH] cmake: Assign the version to the shared library Build systems like Yocto / OpenEmbedded expect a version for shared objects. Unversion file is supposed to be a symlink that is generated at installation time. Change-Id: Iaa07eb3af361e5cb35d96f8d87923b6f7561c455 Signed-off-by: Vyacheslav Yurkov --- CMakeLists.txt | 9 ++++++--- include/libyuv/version.h | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 77e0527fc..392fac7f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -240,6 +240,12 @@ if(UNIT_TEST) endif() endif() +# create the .deb and .rpm packages using cpack +include ( CM_linux_packages.cmake ) + +set_target_properties(${ly_lib_shared} PROPERTIES + VERSION ${YUV_VERSION} SOVERSION ${YUV_VER_MAJOR} +) # install the conversion tool, .so, .a, and all the header files install ( TARGETS yuvconvert DESTINATION bin ) @@ -247,6 +253,3 @@ install ( TARGETS ${ly_lib_static} DESTINATION lib ) install ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib ) install ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include ) -# create the .deb and .rpm packages using cpack -include ( CM_linux_packages.cmake ) - diff --git a/include/libyuv/version.h b/include/libyuv/version.h index 9f9d18da7..a10f395b3 100644 --- a/include/libyuv/version.h +++ b/include/libyuv/version.h @@ -11,6 +11,8 @@ #ifndef INCLUDE_LIBYUV_VERSION_H_ #define INCLUDE_LIBYUV_VERSION_H_ +// Whenever a breaking change happens in the libyuv's ABI +// YUV_VER_MAJOR has to be updated in the CM_linux_packages.cmake #define LIBYUV_VERSION 1948 #endif // INCLUDE_LIBYUV_VERSION_H_