[Cmake] Shared library versioning

Brad King brad.king at kitware.com
Mon, 12 Jan 2004 10:34:26 -0500 (EST)


On Sat, 10 Jan 2004, Gerard Beekmans wrote:

> I was reading some older threads on the cmake mailinglist dating back to
> June, 2003 regarding patches by Gavin Baker that added support for
> proper shared library versioning in cmake.

I implemented this feature in CVS recently based on Gavin Baker's original
patch.  No release has yet included the feature.  You can set versions
like this:

ADD_LIBRARY(foo SHARED foo.cxx)
SET_TARGET_PROPERTIES(foo PROPERTIES VERSION 1.2 SOVERSION 4)

This will produce

libfoo.so.1.2
libfoo.so.4 -> libfoo.so.1.2
libfoo.so -> libfoo.so.4

The soname of the library will be libfoo.so.4.

If either VERSION or SOVERSION is specified alone, the other is assumed to
have the same value.

-Brad