[cmake-developers] rpaths on Mac

James Bigler jamesbigler at gmail.com
Mon Nov 21 15:41:57 EST 2011


Would what you are proposing make the following easier?  This is how I
setup @rpath on my system.

Why do you need something special?  I use @rpath for the install name by
doing the following:

  if(RELEASE_PUBLIC)
    set_target_properties( my_target PROPERTIES
      INSTALL_NAME_DIR "@rpath"
      BUILD_WITH_INSTALL_RPATH ON
      )
  endif()

Then I do the following for my executables:

    if( RELEASE_INSTALL_BINARY_SAMPLES )
      target_link_libraries( ${target_name}
        -Wl,-rpath, at executable_path/.
        -Wl,-rpath, at executable_path/../../lib
        )
    elseif( RELEASE_PUBLIC)
      target_link_libraries( ${target_name}
        -Wl,-rpath, at executable_path/../lib
        )
    endif()

I also have some code to do some special stuff for BundleUtilities, but I'm
not sure if it's related to the rpath stuff.

James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20111121/9c9f2f59/attachment.html>


More information about the cmake-developers mailing list