[CMake] How to prevent relinking targets with shared libraries

Bill Hoffman bill.hoffman at kitware.com
Fri Feb 22 04:07:28 EST 2008


BlinkEye wrote:
> 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 ...
> 
No, I don't think so.  I don't see how CMake can tell if the interface 
changed or not.  How did the makefiles do that?

-Bill


More information about the CMake mailing list