<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>&nbsp; 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&nbsp; 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>&gt; Date: Wed, 10 Jun 2009 11:03:56 +0200<br>&gt; Subject: Re: [CMake] Installation package<br>&gt; From: eric.noulard@gmail.com<br>&gt; To: mathieu.malaterre@gmail.com<br>&gt; CC: chose29@hotmail.com; cmake@cmake.org<br>&gt; <br>&gt; 2009/6/10 Mathieu Malaterre &lt;mathieu.malaterre@gmail.com&gt;:<br>&gt; &gt; On Wed, Jun 10, 2009 at 10:17 AM, Pascale B&lt;chose29@hotmail.com&gt; wrote:<br>&gt; &gt;&gt; Hi,<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; &nbsp; &nbsp;I work on a software that I am porting onto Linux. I used CMake with<br>&gt; &gt;&gt; success and now want to use CPack. I successfully created a package file<br>&gt; &gt;&gt; with a bin and lib path, both containing the exec file and the .so libraries<br>&gt; &gt;&gt; needed.<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; &nbsp; &nbsp;Now &nbsp;here is my problem: when I send this package to a user, after he<br>&gt; &gt;&gt; unzips the package, he needs to move the shared libraries to the /usr/lib<br>&gt; &gt;&gt; directory and proceed with the ldconfig command, otherwise when launching<br>&gt; &gt;&gt; the exec file the shared libraries aren't found.<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; &nbsp; &nbsp;Is there a way to automatically do this? I can't find it in the doc or in<br>&gt; &gt;&gt; mailing lists either. Should a makefile be included with the package that<br>&gt; &gt;&gt; would proceed with the installation or does it need to be done manually each<br>&gt; &gt;&gt; time?<br>&gt; &gt;<br>&gt; &gt; No this is standard UNIX mechanism. On Win32 system, executables will<br>&gt; &gt; look for dll within the same directory and simple packaging works out<br>&gt; &gt; of the box.<br>&gt; &gt; The closest thing to reproduce this mechanism on *nix system is<br>&gt; &gt; implemented within kwsys (see SharedForward.h.in). Please note that<br>&gt; &gt; this is an invasive solution.<br>&gt; &gt;<br>&gt; &gt; A user can simply extent the LD_LIBRARY_PATH to accommodate for your<br>&gt; &gt; particular package, else you have to install you lib in system path<br>&gt; &gt; (/usr/lib for example).<br>&gt; <br>&gt; I did not see this as Mathieu did, in fact this is another solution,<br>&gt; pursuing the same idea<br>&gt; May be you can use Full RPATH:<br>&gt; <br>&gt; http://www.cmake.org/Wiki/CMake_RPATH_handling#Always_full_RPATH<br>&gt; <br>&gt; Another "easy" solution would be to ship with your executable(s) a simple<br>&gt; (shell) script wrapper, let's call it runme.sh, which may run any of<br>&gt; your executable by doing automatically updating the LD_LIBRARY_PATH.<br>&gt; <br>&gt; assume your software is always installed like this<br>&gt; <br>&gt; &lt;varbase&gt;/bin/runme.sh<br>&gt; &lt;varbase&gt;/bin/me<br>&gt; &lt;varbase&gt;/lib/lib4me.so<br>&gt; <br>&gt; if you do<br>&gt; <br>&gt; runme.sh me<br>&gt; <br>&gt; then you will obtain something like:<br>&gt; $ runme.sh me.sh<br>&gt; I am &lt;/home/eric/Test/bin/runme.sh&gt; and my full path is &lt;/home/eric/Test/bin&gt;<br>&gt; Setting LD_LIBRARY_PATH to &lt;:/home/eric/Test/lib&gt;<br>&gt; Executing &lt;me.sh&gt;...<br>&gt; Hi that's me.<br>&gt; <br>&gt; I join the runme.sh and me.sh example, in my case I have no executable<br>&gt; and lib4me.so<br>&gt; but it should work in this case too, whereever you put  /lib and /bin<br>&gt; dirs as soon<br>&gt; as you /bin is in the path.<br>&gt; <br>&gt; Note that letting user playing with LD_LIBRARY_PATH with your<br>&gt; application is generally<br>&gt; a security breach but security may not be your primary objective.<br>&gt; <br>&gt; -- <br>&gt; 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>