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 <uvv.mail@gmail.com>
This commit is contained in:
Vyacheslav Yurkov 2026-06-15 05:58:04 +00:00
parent d23308a2a7
commit bf96ced12d
2 changed files with 8 additions and 3 deletions

View File

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

View File

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