MantisBT - CMake
View Issue Details
0015719CMakeCMakepublic2015-08-28 20:032016-06-10 14:31
David Froger 
Kitware Robot 
normalmajoralways
closedmoved 
GNU/Linux
CMake 3.2.3 
 
0015719: cmake miss --rapth-link when bin/c++ and lib/libfoo.so are in same directory
When linking an executable with a library `libfoo.so` that depedent on a library
`libbar.so` in a non standard directory, flag `-Wl,-rpath-link=...` is required
so that `ld` can find `libar.so`.

It works well with /usr/bin/gcc and libraries somewhere in a non standard
directory, CMake uses the flag `-Wl,-rpath-link`.

But in this case:
    /path/to/somewhere/bin/gcc
    /path/to/somewhere/lib/libfoo.so
    /path/to/somewhere/lib/libbar.so

and with /path/to/somewhere/bin in the PATH, without setting LD_LIBRARY_PATH,
CMake drops the flag `-Wl,-rpath-link=...` and the build fails.
https://github.com/dfroger/secondary_dep [^]
http://public.kitware.com/pipermail/cmake/2015-August/061433.html [^]
No tags attached.
Issue History
2015-08-28 20:03David FrogerNew Issue
2015-08-29 17:10David FrogerNote Added: 0039352
2016-06-10 14:29Kitware RobotNote Added: 0042831
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0039352)
David Froger   
2015-08-29 17:10   
Maybe the problem is that the directory containing libbar.so is in `gcc -print-search-dirs`, and CMake wrongly assumes that this directory is search by ld too.
(0042831)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.