Why does CMake use relative linking when I replace a shared object?
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.
On 11/25/2011 12:19 PM, Mathias Gaunard wrote:
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.
Oops sorry wrong mailing list!
participants (1)
-
Mathias Gaunard