[CMake] Simple (?) problem with libraries & executable dependencies

Alexander Neundorf a.neundorf-work at gmx.net
Tue Feb 15 15:35:19 EST 2011


On Tuesday 15 February 2011, Carminati Federico wrote:
> Hello Michael,
>    thanks a lot for looking into my problem. It turns out that Mac OS X
> behaves a bit oddly, in the sense that the name of the directory of
> installation is in the libraries as well as in the executable. I solved the
> problem with a single line setting the properties of the library in the
> following way:
>
>   set_target_properties(${PACKAGE} PROPERTIES INSTALL_NAME_DIR
> ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})

That doesn't look right.
CMAKE_LIBRARY_OUTPUT_DIRECTORY is the directory where the library is built, 
not the directory where it is installed to.
Is libMUONevaluation.so actually getting installed or is that an old version 
which is already in /usr/local ?

Maybe it is not and the executable doesn't find it then, because it has not 
been installed ?

Also, I thought on OSX it's DYLD_LIBRARY_PATH, and not LD_LIBRARY_PATH. AFAIK 
you also don't have an RPATH, but instead INSTALL_NAME_DIR.

Alex


More information about the CMake mailing list