tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CMake shared libs on MacOSX



Hello,

I have a problem with CMake on Mac OS X. When I try to install a shared library 
(for example, by building and installing audio/libmusicbrainz), I see the 
library install name is wrong, and as a consequence, programs refuse to run, 
since the library can't be found.

# otool -L /usr/pkg/lib/libmusicbrainz3.6.2.0.dylib
/usr/pkg/lib/libmusicbrainz3.6.2.0.dylib:
        libmusicbrainz3.6.dylib (compatibility version 6.0.0, current version 
6.2.0)
        /usr/pkg/lib/libneon.27.dylib (compatibility version 30.0.0, current 
version 30.3.0)
        /usr/pkg/lib/libdiscid.0.dylib (compatibility version 3.0.0, current 
version 3.1.0)
        /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current 
version 7.9.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
version 125.2.0)

The first line should be:
        /usr/pkg/lib/libmusicbrainz3.6.dylib (compatibility version 6.0.0, 
current version 6.2.0)

My guess is 'install_name_tool' is not called, while it should be during 
install phase. (To fix this manually, I do: sudo install_name_tool -id 
/usr/pkg/lib/libmusicbrainz3.6.dylib /usr/pkg/lib/libmusicbrainz3.6.dylib).

As my knowledge of CMake is very limited, any advice is welcome.

Kind regards,
Adam


Home | Main Index | Thread Index | Old Index