<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;&nbsp; The RPATH solution works locally only, on my computer only when used with the make install command. But now, I seem to have problem to use Cmake to create RPMs and I think it has to do with the root directory of rpmbuild. As I wrote previously, I use CPack to create a tar.Z file successfully. In my CMakeLists.txt, I added as suggested:<br><br>...<br>SET(CPACK_GENERATOR "TZ;RPM")<br>SET(CPACK_RPM_PACKAGE_DEBUG 1)<br><br>INCLUDE(CPack)<br>...<br><br>Following this, _CPack_Packages is created in the location "Where to build the binaries" specified in cmake Gui (what is the command to fetch this variable from CMakeLists.txt?). Under _CPack_Packages is created a directory structure Linux&gt;RPM and Linux&gt;TZ.<br><br>When typing : make package<br><br>I get the following error:<br><br>CPack: Finalize package<br>CPack Error: Problem copying the package: /media/disk/MyApp/MyApp_sources/lnx/_CPack_Packages/Linux/RPM/MyApp_sources-0.1.1-Linux.rpm to /media/disk/MyApp/MyApp_sources/lnx/MyApp_sources-0.1.1-<b>Linux</b>.rpm<br>CPack Error: Error when generating package: drop_sources<br>make: *** [package] Error 1<br><br>and the following in the rpmbuild.err file:<br><br>error: File not found by glob: <b>/home/pascale/rpmbuild</b>/BUILDROOT/MyApp_sources-0.1.1-1.<b>x86_64</b>/*<br>&nbsp;&nbsp;&nbsp; File not found by glob: <b>/home/pascale/rpmbuild</b>/BUILDROOT/MyApp_sources-0.1.1-1.x86_64/*<br><br>How can the desired folder be created automatically? Or should I specify another folder? I notice that the folder created by CPack has the name ..Linux wheras packaging seems to be looking for ...x86_64?<br><br>Thanks for your help in clearing all this for me!<br>Pascale<br><br><br><br><hr id="stopSpelling">From: chose29@hotmail.com<br>To: eric.noulard@gmail.com; mathieu.malaterre@gmail.com<br>Date: Wed, 10 Jun 2009 09:04:18 -0400<br>CC: cmake@cmake.org<br>Subject: Re: [CMake] Installation package<br><br>



<style>
.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Verdana;}
</style>


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">Free us.</a><br /><hr />Windows Live helps you keep up with all your friends,  <a href='http://go.microsoft.com/?linkid=9660824' target='_new'>in one place.</a></body>
</html>