[CMake] CMake/CPack: empty packages
Alan W. Irwin
irwin at beluga.phys.uvic.ca
Mon Feb 15 13:03:22 EST 2010
On 2010-02-15 19:25+0600 Dmitry wrote:
> Hello!
> I've started using CMake not long ago, I'm not very familiar with it yet. I
> need to generate a package with CMake, but when I try to do it, I get empty
> packages. This is my CMakeLists.txt file (just a simple "hello, world"
> application of a single .cpp file):
Some others have answered you that you need a relative installation directory.
That will work, but there is another alternative which Bill Hoffman stated
some time ago (for those who need an absolute install location)
which I will quote:
"By default CPack does not use the DESTDIR option during the installation
phase. Instead it sets the CMAKE_INSTALL_PREFIX to the full path of the
temporary directory being used by CPack to stage the install package. This
can be changed by setting CPACK_SET_DESTDIR to on. If the DESTDIR option is
on, CPack will use the projects cache value for CPACK_INSTALL_PREFIX, and
set DESTDIR to the temporary staging area. This allows absolute paths to be
installed under the temporary directory. Relative paths are installed into
DESTDIR/${project’s CMAKE_INSTALL_PREFIX} where DESTDIR is set to the
temporary staging area.
I think you want CPACK_SET_DESTDIR, then make sure CMAKE_INSTALL_PREFIX is
how you want it before you run cpack."
I haven't tried that for myself yet, and cannot find documentation for
CPACK_SET_DESTDIR, but it is worth a try for the case where you need an
absolute install path. I earmarked Bill's old list message with regard to
this issue in case PLplot (which must have an absolute install directory)
ever wants to distribute a binary package.
Alan
__________________________
Alan W. Irwin
Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).
Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________
Linux-powered Science
__________________________
More information about the CMake
mailing list