diff --git a/CMakeLists.txt b/CMakeLists.txt index 21c64b0b926..aa2fe14fe23 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -428,7 +428,9 @@ if (APPLE) set(CMAKE_INSTALL_NAME_DIR "@rpath") set(CMAKE_INSTALL_RPATH "@executable_path/../lib") else(UNIX) - set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib") + if(NOT DEFINED CMAKE_INSTALL_RPATH) + set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib") + endif(NOT DEFINED CMAKE_INSTALL_RPATH) endif() set(CMAKE_INCLUDE_CURRENT_DIR ON)