[CMake] How to get RPATH option (-Wl,-rpath,/path/to/local/lib) ?

Franck Houssen franck.houssen at inria.fr
Wed Jan 31 04:39:51 EST 2018


How to get RPATH option (-Wl,-rpath,/path/to/local/lib) ? 

I would like to create a *.pc/cmake file for users to find a library I provide. As there is possibly a LOT of dependencies (libraries) I may not even be able to list, the most simple way to do that is to use RPATH. I know that for gcc, RPATH is set with "-Wl,-rpath". But what about others compilers (pgi, icc) ? This option could not be the same. 

Is it possible to "grab" the correct RPATH option (-Wl,-rpath) according to the compiler ? Something like a CMAKE_RPATH_OPTIONS to substitute in a *.pc/cmake.in template file ? (to create a *.pc/cmake file in the install directory using configure_file) 

Franck 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180131/53e22146/attachment.html>


More information about the CMake mailing list