[CMake] 'make dist' like target

Enrico Scholz enrico.scholz at informatik.tu-chemnitz.de
Mon Nov 13 05:13:04 EST 2006


Hello,

I am looking for something which works like 'make dist' and/or 'make
distcheck' from automake. For those who are unfamilar with automake:

These commands are used to create a tarball of the project sources.
'automake' adds (nearly) every sourcefile which was used to build a
binary to the tarball and allows to specify additional files which were
created during the build. It does *not* package everything under the
sources.

'make distcheck' checks whether tarball is complete by running the
'./configure && make' sequence plus some additional tests.


I could not find something similar for cmake; simply taring the whole
source directory is a bad idea because:

* it might add temporary files (.nfs*, backup files, leftovers from SCM
  merge operations)
* it might package binary files
* it might add files of the SCM system (e.g. CVS, .git, ...)
* it might add files which shall not be published

Adding files which were created during the build (e.g. *.spec files) to
an existing tar file is not trivial because files are usually in a
subdirectory (<project-name>-<project-version>/).


How is tarfile creation solved by CMake? I read about CPack but this is
nearly undocumented and seems to be focused on packaging binaries.

Or: How do I specifiy which (source)files and/or generated files are
packaged by CPack? How do I exclude files from being packaged by CPack? 
How do I tell CPack to create .tar.bz2 archives? How do I append a
post-CPack target (e.g. 'make gpgsig' would be 'gpgsig: dist\n gpg
--sign ...' with normal make)



Enrico



More information about the CMake mailing list