[CMake] rpath and BSD

Brad King brad.king at kitware.com
Thu Nov 9 10:16:06 EST 2006


Pierre Chifflier wrote:
> One of the remaining problems is that cmake seems to ignore RPATH
> parameters on *BSD systems: I tried various combinations of the
> variables CMAKE_INSTALL_RPATH, CMAKE_SKIP_BUILD_RPATH,
> CMAKE_BUILD_WITH_INSTALL_RPATH and CMAKE_INSTALL_RPATH_USE_LINK_PATH,
> but couldn't get it to work: the resulting executable has no rpath
> set, whatever I try.

It looks like rpath support is not configured in the OpenBSD.cmake
platform file.  Look for this file under share/CMake/Modules/Platform.
There is a FreeBSD.cmake file next to it that may have the rpath flags
enabled.  You probably need to add something like this to the
OpenBSD.cmake file:

  SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
  SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")

The actual values should match the platform's rpath flags.  If you get
it working please send a patch.

In order for a platform to have first-class support there must be a
nightly testing dashboard submission here:

http://public.kitware.com/dashboard.php?name=cmake

Currently there is no submission for OpenBSD.  If you are able to
contribute a nightly build (about 30 minutes of compute time per night
on one machine) it would be appreciated and we would be able to make
sure CMake keeps working on the platform.  Contact me off the list if
you are interested in setting this up.

Thanks,
-Brad



More information about the CMake mailing list