<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Hi,<br><br> I have created rpm files now. I only needed to fix the root path problem (I've seen a couple mailing lists that could be useful). But now I've tried the FULL RPATH solution that you sent (http://www.cmake.org/Wiki/CMake_RPATH_handling#Always_full_RPATH) and it works fine.<br><br>Thanks so much for your help!!<br>Pascale<br><br>set of variables I used in my main CMakeLists.txt, before any INSTALL:<br>#--------------------------------------------<br># make sure libraries are found with the exec created<br>#--------------------------------------------<br># use, i.e. don't skip the full RPATH for the build tree<br>SET(CMAKE_SKIP_BUILD_RPATH FALSE)<br><br># when building, don't use the install RPATH already<br># (but later on when installing)<br>SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) <br><br># the RPATH to be used when installing<br>SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")<br><br># add the automatically determined parts of the RPATH<br># which point to directories outside the build tree to the install RPATH<br>SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)<br><br><br><br><br><br><br>> Date: Wed, 10 Jun 2009 11:03:56 +0200<br>> Subject: Re: [CMake] Installation package<br>> From: eric.noulard@gmail.com<br>> To: mathieu.malaterre@gmail.com<br>> CC: chose29@hotmail.com; cmake@cmake.org<br>> <br>> 2009/6/10 Mathieu Malaterre <mathieu.malaterre@gmail.com>:<br>> > On Wed, Jun 10, 2009 at 10:17 AM, Pascale B<chose29@hotmail.com> wrote:<br>> >> Hi,<br>> >><br>> >> I work on a software that I am porting onto Linux. I used CMake with<br>> >> success and now want to use CPack. I successfully created a package file<br>> >> with a bin and lib path, both containing the exec file and the .so libraries<br>> >> needed.<br>> >><br>> >> Now here is my problem: when I send this package to a user, after he<br>> >> unzips the package, he needs to move the shared libraries to the /usr/lib<br>> >> directory and proceed with the ldconfig command, otherwise when launching<br>> >> the exec file the shared libraries aren't found.<br>> >><br>> >> Is there a way to automatically do this? I can't find it in the doc or in<br>> >> mailing lists either. Should a makefile be included with the package that<br>> >> would proceed with the installation or does it need to be done manually each<br>> >> time?<br>> ><br>> > No this is standard UNIX mechanism. On Win32 system, executables will<br>> > look for dll within the same directory and simple packaging works out<br>> > of the box.<br>> > The closest thing to reproduce this mechanism on *nix system is<br>> > implemented within kwsys (see SharedForward.h.in). Please note that<br>> > this is an invasive solution.<br>> ><br>> > A user can simply extent the LD_LIBRARY_PATH to accommodate for your<br>> > particular package, else you have to install you lib in system path<br>> > (/usr/lib for example).<br>> <br>> I did not see this as Mathieu did, in fact this is another solution,<br>> pursuing the same idea<br>> May be you can use Full RPATH:<br>> <br>> http://www.cmake.org/Wiki/CMake_RPATH_handling#Always_full_RPATH<br>> <br>> Another "easy" solution would be to ship with your executable(s) a simple<br>> (shell) script wrapper, let's call it runme.sh, which may run any of<br>> your executable by doing automatically updating the LD_LIBRARY_PATH.<br>> <br>> assume your software is always installed like this<br>> <br>> <varbase>/bin/runme.sh<br>> <varbase>/bin/me<br>> <varbase>/lib/lib4me.so<br>> <br>> if you do<br>> <br>> runme.sh me<br>> <br>> then you will obtain something like:<br>> $ runme.sh me.sh<br>> I am </home/eric/Test/bin/runme.sh> and my full path is </home/eric/Test/bin><br>> Setting LD_LIBRARY_PATH to <:/home/eric/Test/lib><br>> Executing <me.sh>...<br>> Hi that's me.<br>> <br>> I join the runme.sh and me.sh example, in my case I have no executable<br>> and lib4me.so<br>> but it should work in this case too, whereever you put /lib and /bin<br>> dirs as soon<br>> as you /bin is in the path.<br>> <br>> Note that letting user playing with LD_LIBRARY_PATH with your<br>> application is generally<br>> a security breach but security may not be your primary objective.<br>> <br>> -- <br>> Erk<br><br /><hr />Attention all humans. We are your photos. <a href='http://go.microsoft.com/?linkid=9666044' target='_new'>Free us.</a></body>
</html>