diff options
-rwxr-xr-x | cmake/Modules/BuildMacros.cmake | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cmake/Modules/BuildMacros.cmake b/cmake/Modules/BuildMacros.cmake index 3630d2e26..276659525 100755 --- a/cmake/Modules/BuildMacros.cmake +++ b/cmake/Modules/BuildMacros.cmake @@ -23,6 +23,9 @@ macro(build_executable exec) ${ARGN} ) + set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + add_executable(${exec} ${ARG_SOURCES}) if(ARG_LINK_LIBRARIES) target_link_libraries(${exec} ${ARG_LINK_LIBRARIES}) @@ -56,6 +59,9 @@ macro(build_library lib) ${ARGN} ) + set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + if (ARG_SHARED) list(APPEND TARGET_LIBS ${lib}.shared @@ -150,4 +156,4 @@ macro(AddTest testFile) add_test(${ARGV0} ${ARGV0}) set_target_properties(${ARGV0} PROPERTIES FOLDER Test) add_dependencies(${ARGV0} ${PROJECT_NAME}_cleanup_profiling_data) -endmacro(AddTest)
\ No newline at end of file +endmacro(AddTest) |