Adjust loader path resolution on Mac OS X.
authorM. Eric Irrgang <ericirrgang@gmail.com>
Mon, 3 Sep 2018 14:14:01 +0000 (17:14 +0300)
committerPaul Bauer <paul.bauer.q@gmail.com>
Wed, 5 Sep 2018 15:08:38 +0000 (17:08 +0200)
commit51a5bf8fcd68bed5af33c95678732a1d93c68d40
treea55abac31173bbebd9fcf86c081877e5dbb8f248
parent15b4b09fac08037a2cf0a41e49d45bafe4ff99ea
Adjust loader path resolution on Mac OS X.

For macOS builds, use @loader_path instead of @executable_path for
libgromacs install_name. For internal GROMACS usage, this change should
have no observable effect.

For binaries linking to libgromacs, using @executable_path in the shared
library install_name allows a path to be resolved relative to the
executable, which works for binaries at a particular level of the
installation directory, but not for executables outside of GROMACS.

Switching to @loader_path means the path is relative to the binary with
the load command, which for GROMACS code is the same as
@executable_path, but for a libgmxapi library installed with GROMACS,
using @loader_path allows a binary linking against libgmxapi to
transitively load libgromacs relative to the libgmxapi installation
location in the GROMACS tree.

Change-Id: Ife76c59b138da58a92a0d00599c394c61fe612f9
CMakeLists.txt