Boost logo

Boost Users :

Subject: [Boost-users] Why does CMake use relative linking when I replace a shared object?
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2011-11-25 06:19:00


There is some strange CMake behaviour I don't quite understand.

In the project attached, I build a shared library for which I want to
specify a custom build command; to do this I generate a dummy library
which I then replace by another file in a POST_BUILD command
(alternatives involving imported libraries do not work properly across
different scopes).

If I do not replace the library, then the executable correctly links
against libtest.so.
If I do, it links instead with ../baz/libtest.so (sic), which of course,
fails when trying to run the program.

Why is it putting a relative path into my executable? Why is it
different depending on whether I replace the .so by another one or not?

Thank you very much for any insight on what's happening.




Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net