[cmake-developers] [CMake 0015719]: cmake miss --rapth-link when bin/c++ and lib/libfoo.so are in same directory

Mantis Bug Tracker mantis at public.kitware.com
Fri Aug 28 20:03:29 EDT 2015


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=15719 
====================================================================== 
Reported By:                David Froger
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15719
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2015-08-28 20:03 EDT
Last Modified:              2015-08-28 20:03 EDT
====================================================================== 
Summary:                    cmake miss --rapth-link when bin/c++ and
lib/libfoo.so are in same directory
Description: 
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.


Steps to Reproduce: 
https://github.com/dfroger/secondary_dep


Additional Information: 
http://public.kitware.com/pipermail/cmake/2015-August/061433.html
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2015-08-28 20:03 David Froger   New Issue                                    
======================================================================



More information about the cmake-developers mailing list