[CMake] copying the contents of a directory with cpack

Alan W. Irwin irwin at beluga.phys.uvic.ca
Mon Sep 17 23:37:42 EDT 2007


On 2007-09-17 20:31-0400 Bill Hoffman wrote:

> Niall Dalton wrote:
>> Hi,
>> 
>> I have a custom target that creates doxygen documentation from my C header 
>> files. I'd like, as part of my cpack configuration in my main 
>> CMakeLists.txt, to copy the directory containing the doxygen output into 
>> the .tar.gz package.
>> 
>> What is the simplest way to do this?
> Basically, cpack just uses whatever make install does.  So, you would need to 
> use the install commands in cmake.  Once those are working cpack should work.

That advice is correct for generating binary distributions with "make
package", but in case you wanted to include the doxygen output in a source
distribution with the "make package_source" command, then all you have to do
is make your build tree a subdirectory of your source tree or copy the
doxygen output from the build tree to the source tree.  By default, "make
package_source" packages everything in the source tree, and you use a regex
expression variable called CPACK_SOURCE_IGNORE_FILES to ignore anything you
do not want.  To see how to set this up, have a look at the top-level
CMakeLists.txt file of CMake itself.

To those in charge of the Wiki: I am all for terse but useful documentation,
but somebody has removed so much information from 
http://www.cmake.org/Wiki/CMake:Packaging_With_CPack that it is almost
meaningless now.  Please revert it back to the previous version which at
least supplies quite a bit of information about CPack.  We also need some
real documentation when you run "cpack --help-full". The problem with that
command (at least for 2.4.7) is it gives you mostly just a template
placeholder for documentation. Instead, you need some real documentation
there of all the variables you can set from CMake when you INCLUDE the CPack
Module, and at least a mention of the make targets (package and
package_source) that are generated and the rules for including material in
binary distributions and source distributions.

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