Correctly set rpath for unittests.

This lets us run the unittest from the command line without setting
LD_LIBRARY_PATH.

llvm-svn: 202509
This commit is contained in:
Rafael Espindola 2014-02-28 16:11:03 +00:00
parent 722311edc8
commit 9e806cf938
1 changed files with 6 additions and 0 deletions

View File

@ -1,6 +1,12 @@
add_custom_target(UnitTests)
set_target_properties(UnitTests PROPERTIES FOLDER "Tests")
if (APPLE)
set(CMAKE_INSTALL_RPATH "@executable_path/../../lib")
else(UNIX)
set(CMAKE_INSTALL_RPATH "\$ORIGIN/../../lib")
endif()
function(add_llvm_unittest test_dirname)
add_unittest(UnitTests ${test_dirname} ${ARGN})
endfunction()