From d60caf709540dd2fd81f1c6712db17593c22e2f2 Mon Sep 17 00:00:00 2001 From: Clint Harris Date: Sat, 22 Mar 2014 11:44:51 -0400 Subject: [PATCH] CMake now adds RPATH info to executables. Resolves issue #960. --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b38a38b35..deb6cdfe8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -222,6 +222,14 @@ endif() file(GLOB InstallGlob Include/osrm/*.h Library/OSRM.h) +# Add RPATH info to executables so that when they are run after being installed +# (i.e., from /usr/local/bin/) the linker can find library dependencies. For +# more info see http://www.cmake.org/Wiki/CMake_RPATH_handling +set_property(TARGET osrm-extract PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE) +set_property(TARGET osrm-prepare PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE) +set_property(TARGET osrm-datastore PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE) +set_property(TARGET osrm-routed PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE) + install(FILES ${InstallGlob} DESTINATION include/osrm) install(TARGETS osrm-extract DESTINATION bin) install(TARGETS osrm-prepare DESTINATION bin)