[CMake] using CPack

Alan W. Irwin irwin at beluga.phys.uvic.ca
Tue Sep 25 22:54:41 EDT 2007


On 2007-09-25 20:14-0500 Javier Gonzalez wrote:

> Hi all,
>
> I just started using cmake and it seems I can't figure out how to use
> CPack. The documentation in the wiki page didn't help much.
>
> I can do make, make install and it all works all right but if I do make
> package I get and empty package (a tar ball with nothing in it).

"make package" does not work (produces empty results rather than the desired
binary package) for absolute install prefixes.  You could use relative
install locations (see the documentation of the INSTALL command), or if you
must use absolute install locations (as in the PLplot case) there is a
simple patch to the cmake core that makes "make package" work in that case,
see bug report 4993.

To Bill Hoffman (who has been assigned this bug) .  When is this simple
patch going to be available in at least the cvs version?


> Also,
> if I do make package_source the thing goes and compresses everything.
> This last thing is not what I expected. I somehow expected to see only
> the sources needed for the targets and that I would have to explicitly
> say what to add on top of the required sources.

I suggest you use an entirely separate directory location for your build
tree.  That will keep your source tree pristine.  Then "make package_source"
collects everything in your (now pristine) source tree and puts it into a
compressed tarball.  If there are some source files you want to skip (e.g.,
everything in CVS or .svn directories) then appropriately adjust the list of
regex expressions you put into the CPACK_SOURCE_IGNORE_FILES variable
(documented in http://www.cmake.org/Wiki/CMake:CPackConfiguration).
Alternatively, I guess you could use a build tree within the source tree,
but then you will need a very long CPACK_SOURCE_IGNORE_FILES list of regex
expressions to get rid of all the generated files from your source package.

Hope this helps.

To the cmake developers.  CPack is obviously extraordinarily useful because
so many "obvious" questions about it keep popping up on list.  Users like me
are willing to help out with such questions for quite a while, but at some
point you have to properly document CPack (not just a Wiki which in any case
has recently had most of the interesting information removed for some
reason) to reduce the number of such questions.  How about (a) restoring the
information that was removed from
http://www.cmake.org/Wiki/CMake:Packaging_With_CPack, and (b) introducing
proper documentation of cpack?  I have asked these questions recently here
before and got no response from those in charge of cmake/cpack which leaves
a really bad impression.

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