[CMake] so lib symlinks

Michael Hertling mhertling at online.de
Fri Nov 19 11:28:06 EST 2010


On 11/19/2010 02:35 PM, luxInteg wrote:
> Greetings,
> 
> I am learning cmake.  I practice using the   "add_library comand" as shown 
> below
> 
> 
> set(serial "1.2.3")
> add_library(testLIB SHARED testLIB.c)
> set_target_properties(testLIB PROPERTIES VERSION ${serial} SOVERSION 1)
> SET(CMAKE_INSTALL_LIBDIR lib CACHE PATH "Output directory for libraries")
> 
> the result is  in the ~/lib directory after install is the following:-
> 
> -----A----
> libtestLIB.so   a symbolic-link  to  libtestLIB.so.1 
> libtestLIB.so.1   a symbolic-link  to  libtestLIB.so.1.2.3
> 
> 
> which I think is the proper way according to this link. 
> (  http://www.faqs.org/docs/Linux-HOWTO/Program-Library-HOWTO.html ). 
>  However it seems some programs do not  follow the symlinks  as I had unable 
> to open 
> libtestLIB.so.1 in one instance.. [...]

What do you mean with "unable to open libtestLIB.so.1 in one instance"?
What happened exactly? Which messages do you get from which programs?

> [...] It is probably   the rest of the libraries 
> on  my setup has are like so:-
> 
> ---B----
> libtestLIB.so   a symbolic-link  to  libtestLIB.so.1.2.3 
> libtestLIB.so.1   a symbolic-link  to  libtestLIB.so.1.2.3
> 
> 
> So advice would be appreciated on how  one  uses  set_target_properties  or 
> shared libraies to get  a setup as in ---B---.

Usually, it doesn't matter if the .so is linked to the soname'd library
- a link itself, also created by ldconfig - or the actual library file.

Regards,

Michael


More information about the CMake mailing list