diff --git a/CMakeLists.txt b/CMakeLists.txt index 64342405..d7197a55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -104,7 +104,11 @@ endif() # Do some tricky things for the python package option(PYTHON_PACKAGE "Generate a build for a python package, should be OFF except in setupy.py" OFF) if (PYTHON_PACKAGE) - set(CMAKE_INSTALL_RPATH "$ORIGIN") + if (APPLE) + set(CMAKE_INSTALL_RPATH "@loader_path") + else() + set(CMAKE_INSTALL_RPATH "$ORIGIN") + endif() endif() option(WRAP_PYTHON "Generate a pybind11 wrapper" OFF)