How to use PROPERTIES VERSION and SOVERSION?

Friedrich W. H. Kossebau kossebau at kde.org
Fri Apr 11 13:34:21 CEST 2008


Hi,

I have trouble understanding the need for VERSION, or rather the difference to 
SOVERSION, in the command set_target_properties(). Could someone please 
enlighten me of it's use? CMake Wiki is almost unaccessable.

man cmake tells me:
"
For  shared libraries VERSION and SOVERSION can be used to specify the build 
version and api version respectively. When building or installing appropri-
ate symlinks are created if the platform supports symlinks and the linker 
supports so-names. If only one of both is specified the missing is assumed  
to have  the  same  version  number. For executables VERSION can be used to 
specify the build version. When building or installing appropriate symlinks 
are created if the platform supports symlinks. For shared libraries and 
executables on Windows the VERSION attribute is parsed to  extract  
a  "major.minor" version number. These numbers are used as the image version 
of the binary.
"
What is the difference between the build version and api version? Is build 
version the long major.minor.patch-level, and api version just major.minor?

Almost everywhere in KDE this is used:
	set_target_properties( mylibname  PROPERTIES
	  VERSION ${GENERIC_LIB_VERSION}
	  SOVERSION ${GENERIC_LIB_SOVERSION}
	)
with kdelibs/cmake/modules/KDE4Defaults.cmake defining
	set(GENERIC_LIB_VERSION "4.1.0")
	set(GENERIC_LIB_SOVERSION "4")

Now is SOVERSION ${GENERIC_LIB_SOVERSION} really be needed? Or, shouldn't 
GENERIC_LIB_SOVERSION be rather "4.1.0" and VERSION ${GENERIC_LIB_VERSION} be 
left out from set_target_properties()?

What leaves me puzzled is that with cmake 2.4.7 for
	set_target_properties( mylibname PROPERTIES VERSION 6.1 SOVERSION 5 )
I get 
	libmylibname.so -> libmylibname.so.5*
	/home/koder/System/kde-devel/lib/libmylibname.so.5 -> libmylibname.so.6.1*
	/home/koder/System/kde-devel/lib/libmylibname.so.6.1*
Is this really what one wants?

Friedrich


More information about the Kde-buildsystem mailing list