54 #add the automatically determined parts of the RPATH |
54 #add the automatically determined parts of the RPATH |
55 #which point to directories outside the build tree to the install RPATH |
55 #which point to directories outside the build tree to the install RPATH |
56 set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) |
56 set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) |
57 |
57 |
58 if(APPLE) |
58 if(APPLE) |
|
59 #@rpath mangling |
59 set(CMAKE_INSTALL_RPATH "@executable_path/../Frameworks") |
60 set(CMAKE_INSTALL_RPATH "@executable_path/../Frameworks") |
60 #workaround older cmake versions |
61 #install_name_tool for libraries |
61 if(${CMAKE_VERSION} VERSION_LESS "2.8.12") |
62 set(CMAKE_INSTALL_NAME_DIR "@executable_path/../Frameworks") |
62 add_flag_append(CMAKE_C_LINK_FLAGS "-Wl,-rpath -Wl,${CMAKE_INSTALL_RPATH}") |
|
63 add_flag_append(CMAKE_CXX_LINK_FLAGS "-Wl,-rpath -Wl,${CMAKE_INSTALL_RPATH}") |
|
64 add_flag_append(CMAKE_Pascal_LINK_FLAGS "-k-rpath -k${CMAKE_INSTALL_RPATH}") |
|
65 endif() |
|
66 else(APPLE) |
63 else(APPLE) |
67 #paths where to find libraries (final slash not optional): |
64 #paths where to find libraries (final slash not optional): |
68 # - the first is relative to the executable |
65 # - the first is relative to the executable |
69 # - the second is the same directory of the executable (so it runs in bin/) |
66 # - the second is the same directory of the executable (so it runs in bin/) |
70 # - the third one is the full path of the system dir |
67 # - the third one is the full path of the system dir |
71 #source http://www.cmake.org/pipermail/cmake/2008-January/019290.html |
68 #source http://www.cmake.org/pipermail/cmake/2008-January/019290.html |
72 set(CMAKE_INSTALL_RPATH "$ORIGIN/../${target_library_install_dir}/:$ORIGIN/:${CMAKE_INSTALL_PREFIX}/${target_library_install_dir}/") |
69 set(CMAKE_INSTALL_RPATH "$ORIGIN/../${target_library_install_dir}/:$ORIGIN/:${CMAKE_INSTALL_PREFIX}/${target_library_install_dir}/") |
73 endif(APPLE) |
70 endif(APPLE) |
74 |
|
75 #install_name_tool magic for OS X |
|
76 set(CMAKE_INSTALL_NAME_DIR "@executable_path/../Frameworks") |
|
77 |
|