[CMake] shared library linking question

Tim Blechmann tim at klingt.org
Sat Feb 13 09:11:56 EST 2010


>> from my limited understanding of the linking process, it should link with
>> -lcommon instead of using ../common/libcommon.so, since the rpath is
>> already set to ../common. but how can i tell cmake to do this?
> 
> As far as I can see this is ok. At least its the same in the cmake
> projects I'm using. The point is that cmake will change this rpath when
> you run make install (provided you have used install( TARGETS)). It'll
> then set the RPATH to the absolute path of the install location of
> libcommon.so. The linking with ../common/libcommon.so is ok, cmake
> prefers to pass in path+filename to ld instead of using and relying on
> the right order of -L + -l.

thanks ... after changing the library build from SHARED to STATIC and to 
SHARED again, it seems to work ... no idea, why it didn't work before ... :/

anyway, thanks a lot for your help, although it seems that it was an error 
on my side ...

tim

-- 
tim at klingt.org
http://tim.klingt.org

The first question I ask myself when something doesn't seem to be
beautiful is why do I think it's not beautiful. And very shortly you
discover that there is no reason.
  John Cage.




More information about the CMake mailing list