Description
What version of protobuf and what language are you using?
Version: v3.17.0
Language: C++
What operating system (Linux, Windows, ...) and version?
Ubunutu 18.04
What runtime / compiler are you using (e.g., python version or gcc version)
gcc 10.3.0
What did you do?
Build shared library with cmake:
cd cmake && mkdir build && cd build
cmake -Dprotobuf_BUILD_SHARED_LIBS=on ..
make
What did you expect to see
libprotobuf.so.28.0.0 or libprotobuf.so.28 (or symbolic link to it )
What did you see instead?
libprotobuf.so.3.17.0.0
Anything else we should know about your project / environment
When building with autotools the behavior is as expected:
./autogen.sh
./configure --enable-shared
make
For Cmake, the SOVERSION is not set in libprotobuf.cmake:
set_target_properties(libprotobuf PROPERTIES
VERSION ${protobuf_VERSION}
SOVERSION ${protobuf_SOVERSION} # or the variable where 28 is set; this line is missing
OUTPUT_NAME ${LIB_PREFIX}protobuf
DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}")
add_library(protobuf::libprotobuf ALIAS libprotobuf)