[CMake] cmake install - problem at copy

Clark J. Wang dearvoid at gmail.com
Tue Jul 10 03:33:51 EDT 2007


On 7/10/07, B. Carrupt <cmake at digicapt.ch> wrote:
>
>
> It's working now, thanks. I had to add /usr/local/lib in ld.so.conf
> (don't know why it's not there by default) so that the wx libraries
> could be found.
>
> What I don't understand is why it was working when I ran the binary
> from the build/bin directory of cmake directly (or when I copied it
> manually to the location).


When linking the executable in your build directory, cmake explicitly passes
a `-rpath'  option to the compiler/linker. On my system the gcc command
looks like this:

/usr/bin/gcc -fPIC "CMakeFiles/main.dir/main.o" -o bin/main -rdynamic
-L/xxx/build/lib -lhello -Wl,-rpath,/xxx/build/lib

You can run ldd on the executable in the build directory and see exactly
which library it depends on. It should be the library in the build directory
other than `/usr/local/lib'.

Thank you for the ldd command, it's really useful !
>
> B. Carrupt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20070710/ad4cae80/attachment.html


More information about the CMake mailing list