[CMake] Installation package

Pascale B chose29 at hotmail.com
Wed Jun 10 12:16:25 EDT 2009


Hi,

   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:

...
SET(CPACK_GENERATOR "TZ;RPM")
SET(CPACK_RPM_PACKAGE_DEBUG 1)

INCLUDE(CPack)
...

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.

When typing : make package

I get the following error:

CPack: Finalize package
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-Linux.rpm
CPack Error: Error when generating package: drop_sources
make: *** [package] Error 1

and the following in the rpmbuild.err file:

error: File not found by glob: /home/pascale/rpmbuild/BUILDROOT/MyApp_sources-0.1.1-1.x86_64/*
    File not found by glob: /home/pascale/rpmbuild/BUILDROOT/MyApp_sources-0.1.1-1.x86_64/*

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?

Thanks for your help in clearing all this for me!
Pascale



From: chose29 at hotmail.com
To: eric.noulard at gmail.com; mathieu.malaterre at gmail.com
Date: Wed, 10 Jun 2009 09:04:18 -0400
CC: cmake at cmake.org
Subject: Re: [CMake] Installation package








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.
_________________________________________________________________
Windows Live helps you keep up with all your friends, in one place.
http://go.microsoft.com/?linkid=9660826
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090610/bb753bdf/attachment.htm>


More information about the CMake mailing list