48 #source http://www.cmake.org/pipermail/cmake/2008-January/019290.html |
48 #source http://www.cmake.org/pipermail/cmake/2008-January/019290.html |
49 set(CMAKE_INSTALL_RPATH "$ORIGIN/../${target_library_install_dir}/:$ORIGIN/:${CMAKE_INSTALL_PREFIX}/${target_library_install_dir}/") |
49 set(CMAKE_INSTALL_RPATH "$ORIGIN/../${target_library_install_dir}/:$ORIGIN/:${CMAKE_INSTALL_PREFIX}/${target_library_install_dir}/") |
50 set(CMAKE_INSTALL_RPATH_ESCAPED "$$ORIGIN/../${target_library_install_dir}/:$$ORIGIN/:${CMAKE_INSTALL_PREFIX}/${target_library_install_dir}/") |
50 set(CMAKE_INSTALL_RPATH_ESCAPED "$$ORIGIN/../${target_library_install_dir}/:$$ORIGIN/:${CMAKE_INSTALL_PREFIX}/${target_library_install_dir}/") |
51 |
51 |
52 if(UNIX AND NOT APPLE) |
52 if(UNIX AND NOT APPLE) |
53 list(APPEND pascal_flags "-k-rpath" "-k'${CMAKE_INSTALL_RPATH_ESCAPED}'") |
53 list(APPEND pascal_flags "-k-rpath" "-k'${CMAKE_INSTALL_RPATH_ESCAPED}'" "-k-z" "-korigin") |
54 list(APPEND haskell_flags "-optl" "-Wl,-rpath,'${CMAKE_INSTALL_RPATH_ESCAPED}'") |
54 list(APPEND haskell_flags "-optl" "-Wl,-rpath,'${CMAKE_INSTALL_RPATH_ESCAPED},-z,origin'") |
|
55 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,origin") |
|
56 set(CMAKE_SHARED_LIBRARY_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} -Wl,-z,origin") |
|
57 set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -Wl,-z,origin") |
55 endif() |
58 endif() |
56 |
59 |
57 #add the automatically determined parts of the RPATH |
60 #add the automatically determined parts of the RPATH |
58 #which point to directories outside the build tree to the install RPATH |
61 #which point to directories outside the build tree to the install RPATH |
59 set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) |
62 set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) |