From: Rafael Espindola Date: Fri, 28 Feb 2014 16:11:03 +0000 (+0000) Subject: Correctly set rpath for unittests. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=128237d0c70c45664c51fb98a9e8e0bee4cd9211;p=oota-llvm.git Correctly set rpath for unittests. This lets us run the unittest from the command line without setting LD_LIBRARY_PATH. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202509 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index 84685e1c24d..9e2f60c7b87 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -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()