53 |
53 |
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 #paths where to find libraries (final slash not optional): |
58 if(APPLE) |
59 # - the first is relative to the executable |
59 set(CMAKE_INSTALL_RPATH "@executable_path/../Frameworks") |
60 # - the second is the same directory of the executable (so it runs in bin/) |
60 #workaround older cmake versions |
61 # - the third one is the full path of the system dir |
61 if(${CMAKE_VERSION} VERSION_LESS "2.8.12") |
62 #source http://www.cmake.org/pipermail/cmake/2008-January/019290.html |
62 add_flag_append(CMAKE_C_LINK_FLAGS "-Wl,-rpath -Wl,${CMAKE_INSTALL_RPATH}") |
63 set(CMAKE_INSTALL_RPATH "$ORIGIN/../${target_library_install_dir}/:$ORIGIN/:${CMAKE_INSTALL_PREFIX}/${target_library_install_dir}/") |
63 add_flag_append(CMAKE_CXX_LINK_FLAGS "-Wl,-rpath -Wl,${CMAKE_INSTALL_RPATH}") |
64 |
64 add_flag_append(CMAKE_Pascal_LINK_FLAGS "-k-rpath -k${CMAKE_INSTALL_RPATH}") |
|
65 endif() |
|
66 else(APPLE) |
|
67 #paths where to find libraries (final slash not optional): |
|
68 # - the first is relative to the executable |
|
69 # - 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 |
|
71 #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}/") |
|
73 endif(APPLE) |
65 |
74 |
66 #install_name_tool magic for OS X |
75 #install_name_tool magic for OS X |
67 set(CMAKE_INSTALL_NAME_DIR "@executable_path/../Frameworks") |
76 set(CMAKE_INSTALL_NAME_DIR "@executable_path/../Frameworks") |
68 |
77 |