<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> 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>RPM and Linux>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> 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> 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">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>