[CMake] Installation package

Pascale B chose29 at hotmail.com
Wed Jun 10 09:04:18 EDT 2009


Hi,

  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.

Thanks so much for your help!!
Pascale

set of variables I used in my main CMakeLists.txt, before any INSTALL:
#--------------------------------------------
# make sure libraries are found with the exec created
#--------------------------------------------
# use, i.e. don't skip the full RPATH for the build tree
SET(CMAKE_SKIP_BUILD_RPATH  FALSE)

# when building, don't use the install RPATH already
# (but later on when installing)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) 

# the RPATH to be used when installing
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")

# add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)






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

_________________________________________________________________
Attention all humans. We are your photos. Free us.
http://go.microsoft.com/?linkid=9666046
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090610/161d5e6a/attachment-0001.htm>


More information about the CMake mailing list