[CMake] Linking to a library: libfoo.so vs libfoo.so.1.2

Andreas Schneider mail at cynapses.org
Mon May 19 08:08:36 EDT 2008


Mathieu Malaterre wrote:
> Hi there,
> 
>   I am inspecting a system using cmake, this system has the following:
> 
> $ ls -al /lib/libuuid.so.1*
> lrwxrwxrwx 1 root root    14 2008-01-10 17:51 /lib/libuuid.so.1 ->
> libuuid.so.1.2
> -rw-r--r-- 1 root root 10720 2007-12-06 16:55 /lib/libuuid.so.1.2
> 
> 
>   the question is: can I link to this library ? If yes, how do I do
> that in cmake ?
> 
>   I was hoping it should be possible, since it's a c lib and the
> symbol can be found:
> 
> $ nm -D /lib/libuuid.so.1.2 | grep uuid_generate
> 0000000000001700 T uuid_generate

Normally you have a symlink /lib/libuuid.so which points to that file, so it 
is linked against this file.

Read the ld manpage.

As cmake is working with absolute path you can use the file directly too. But 
then you have do search for it manually.

> 
> 
> Thanks,


	-- andreas

-- 
http://www.cynapses.org/ - cybernetic synapses


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 257 bytes
Desc: OpenPGP digital signature
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080519/bda08c61/attachment.pgp>


More information about the CMake mailing list