[CMake] How to set gcc option "-Wl,-rpath-link," ?

Jörg Förstner Joerg.Foerstner at ubidyne.com
Tue Jul 28 12:20:50 EDT 2009


Hi everybody,

how can I set the gcc option "-Wl,-rpath-link," with CMake?

I've tried the following, but I always end up with "-Wl,-rpath," only:

# RPATH settings for linking shared libraries
# skip the full RPATH for the build tree
SET(CMAKE_SKIP_BUILD_RPATH  TRUE)

# when building, use the install RPATH already
# (so it doesn't need to relink when installing)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) 

# the RPATH to be used when installing
#SET(CMAKE_INSTALL_RPATH "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}:${ACE_ROOT}/lib:${LIBXML_2_ROOT}/lib:${LIBXML_PP_ROOT}/lib:${LOG4_CXX_ROOT}/lib:${RUBY_ROOT}/lib")

# add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

I also found somebody using the following, but the used variable seems to be deprecated as I could not find it in the current CMake documentation:
SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")

Best Regards,
Joerg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090728/d10db41d/attachment.htm>


More information about the CMake mailing list