[CMake] "portable" linux binaries?

j s j.s4403 at gmail.com
Sun Nov 29 17:22:05 EST 2009


Hello,

I am running:
cmake version 2.4-patch 7

on Ubuntu 8.04 and I can't get this option to work, whether it is in
CMakeLists.txt or on the command line.

 rm CMakeCache.txt; cmake -DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE
-DCMAKE_INSTALL_RPATH='$ORIGIN/../lib/shared' ../src/; grep RPATH
CMakeCache.txt

rm CMakeCache.txt ; cmake -DBUILD_WITH_INSTALL_RPATH=TRUE
-DINSTALL_RPATH='$ORIGIN/../lib/shared' ../src/ ; grep RPATH CMakeCache.txt

The man page says to use INSTALL_RPATH and BUILD_WITH_INSTALL_RPATH.

strings /usr/bin/cmake | grep RPATH
_ZN8cmTarget20HaveInstallTreeRPATHEv
_ZN8cmTarget18HaveBuildTreeRPATHEv
SKIP_BUILD_RPATH
CMAKE_SKIP_RPATH
BUILD_WITH_INSTALL_RPATH
INSTALL_RPATH_USE_LINK_PATH
< section from man page here >

Regards,

Juan

On Tue, Nov 24, 2009 at 3:46 PM, j s <j.s4403 at gmail.com> wrote:

> Thanks, that should work.
>
> Regards,
>
> Juan
>
> 2009/11/24 Alexander Neundorf <a.neundorf-work at gmx.net>
>
> On Tuesday 24 November 2009, j s wrote:
>> > The most interesting thing is to be able to set the relative RPATH.
>> >
>> > Is there a way to do this for a normal build, and not the install
>> target?
>> > I never use the install target for my project, but I'd like to be able
>> to
>> > set the relative path to my own copy of libstdc++.  All of the RPATH
>> > settings in the man page for cmake 2.4 seem to be in terms of INSTALL.
>>
>> I think you can set the rpath relative to the containing ELF file
>> using "$ORIGIN" in the path.
>>
>> If you want to build directly with the install (or custom) rpath, you can
>> set
>> BUILD_WITH_INSTALL_RPATH to TRUE and then set INSTALL_RPATH as you like.
>>
>> Alex
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20091129/e8837fb7/attachment.htm>


More information about the CMake mailing list