[cmake-developers] Modifying RPATH feature to run tests uninstalled

Brad King brad.king at kitware.com
Fri Feb 17 09:28:44 EST 2012


On 2/17/2012 9:13 AM, Stephen Kelly wrote:
> If CMAKE_SKIP_INSTALL_RPATH is used by our buildsystems and CMAKE_SKIP_RPATH
> is not, distros will learn that they can run unit tests if they build their
> packages with the former instead of the latter.
>
>  From my point of view though, the ENVIRONMENT property manipulation solves
> enough of the problem already. It makes 'make test' work.
>
> What it doesn't fix is running a unit test executable directly without
> setting the environment manually or running make install. I don't see why
> that should be expected to work though if the developer disables the RPATH
> stuff. It also doesn't work currently (without wrapper scripts), so nothing
> is really lost.
>
> However, adding CMAKE_SKIP_INSTALL_RPATH would make that work even if a
> developer wanted to disable RPATH, so maybe it's a nice thing to do.

This is achievable by project code if it never sets INSTALL_RPATH.
However it can be convenient for distros to have a "hammer" like
CMAKE_SKIP_INSTALL_RPATH to avoid patching uncooperative projects.

Distros are using CMAKE_SKIP_RPATH as that hammer now, and it's a
pain for tests.  I think CMAKE_SKIP_INSTALL_RPATH is the right
balance.  It allows tests to run and distros to avoid RPATH in
their packages.

-Brad



More information about the cmake-developers mailing list