Skip to content

No SOVERSION is set in shared library Cmake build #8635

@weichslgartner

Description

@weichslgartner

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)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions