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

Stephen Kelly steveire at gmail.com
Fri Feb 17 09:13:43 EST 2012


Alexander Neundorf wrote:

> On Friday 17 February 2012, Stephen Kelly wrote:
> ...
>> The other issue is regarding setting RPATH for the build step and not the
>> install step, and what syntax should be used for that.
>> 
>> The options are:
>> 
>> a) Change the behaviour of CMAKE_SKIP_RPATH to set the RPATH in the build
>>    dir (does this need a policy)
>> 
>> b) Add the new variable CMAKE_SKIP_INSTALL_RPATH to skip only the
>>    installation RPATH, but do use it for the build step. (Fits with
>> existing CMAKE_SKIP_BUILD_RPATH)
>> 
>> c) Make the existing CMAKE_SKIP_BUILD_RPATH override CMAKE_SKIP_RPATH if
>> set to false. (This probably would need a policy)
>> 
>> My choice is b), but I don't know if there are good reasons for the
>> others.
> 
> I'm not sure this would help a lot.
> Some people (distro packagers) disable RPATH by setting CMAKE_SKIP_RPATH
> to TRUE.
> CMAKE_SKIP_RPATH is the big switch which overrides all others. So if this
> is used, we would still have no RPATH in the build tree.
> 

Are you saying this is a chicken-egg problem?

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.

Thanks,

Steve.





More information about the cmake-developers mailing list