[CMake] Shared libraries cannot be found after deploying a CPack package
Eric Noulard
eric.noulard at gmail.com
Wed Jul 15 12:05:56 EDT 2009
2009/7/15 Frank Stappers <f.p.m.stappers at tue.nl>:
> With the help of CPack we would like to make packages. Currently,
> we can make packages for MAC OSX (DMG, TSGZ, GZ) and UNIX (RPM, DEB,
> STGZ, GZ). For static builds (so no shared libraries) these packages
> can be deployed in any directory, without any problems. For builds that
> use shared libraries, the binaries inside the packages do not seem to
> work, if they are deployed in a path other than the $CMAKE_INSTALL_PREFIX.
This depends on how you configured RPATH handling with CMake:
Did you read the different way to handle RPATH with CMake?
http://www.cmake.org/Wiki/CMake_RPATH_handling
> So the question is as follows: Is it possible for CPack to create
> packages that can be installed in a directory that deviates from
> the $CMAKE_INSTALL_PREFIX? If so, which variables/modules do I need
> set/execute?
This is not really a CPack problem, CPack is "only"
callind the "install" rule built by CMake
which may include relink (see previous ref).
Then if ever you build without RPATH then it becomes the
specific generator problem. It will have to either:
1) relink to setup proper RPATH at **installation time**
(no CPack any more at that time)
2) setup again **at install time**
some LD_LIBRARY_PATH, /etc/ld.so.conf.d/*
or any mean that modify the dynamic library path
on the target system (user or system-wide)
Dumb installer like TGZ and GZ and the like do not include
post-install steps which would make this possible.
Smarter one like RPM or DEB may be used to launch
post-install scripts which may accomplish such tasks.
There is a patch pending for post/pre install script
support for CPack RPM
http://public.kitware.com/Bug/view.php?id=8988
--
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
More information about the CMake
mailing list