[CMake] How to prevent relinking targets with shared libraries

BlinkEye gentoo at blinkeye.ch
Fri Feb 22 02:21:24 EST 2008


On Thu, February 21, 2008 22:23, Alan W. Irwin wrote:
> On 2008-02-21 21:57+0100 blinkeye wrote:
>
>> [...]At the moment I'm just creating plain .so libs, without any
>> version number (so far I didn't happen to come across a shared library
>> tutorial with cmake), maybe this is the problem? Does cmake support such a
>> versioning and would that resolve the relinking?
>
> There is full support for shared libraries (at least on my Linux platform).
>
> Look at the documentation of SET_TARGET_PROPERTIES (especially where
> it mentions VERSION, SOVERSION, and RPATH.)
>

Great, thanks for the hint. So, I set a VERSION and SOVERSION on my library:

add_library( mylib SHARED ${SRCS} )
set_target_properties( mylib PROPERTIES VERSION 1 SOVERSION 1 )

But still, any change to 'mylib' requires all targets linked against 'mylib' to be
relinked again ...



More information about the CMake mailing list