diff --git a/CMakeLists.txt b/CMakeLists.txt index ac3e9090336d9..befd9d6599e94 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,6 +56,11 @@ if (MSVC) add_compile_options("$<$:/bigobj>") endif() +if (CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) + set(CMAKE_INSTALL_RPATH $ORIGIN) +endif() + # # option list #