[CMake] cpack makes good source release, but empty binary release

Alan W. Irwin irwin at beluga.phys.uvic.ca
Fri Dec 15 19:51:29 EST 2006


My first attempt to post this failed because the attached
install_manifest.txt was 45K, but it compresses well (with all those
identical install prefixes) so this time should work, I hope.

I am using cmake/cpack 2.4.5 to build and release PLplot.  I can make a good
source release, but I must not be setting up the CPACK variables properly
because all I can get on Linux is an empty tarball for a binary release.

Here are the CPACK related variables we set up:

set(VERSION 5.7.1)

# CPack version numbers for release tarball name.
set(CPACK_PACKAGE_VERSION_MAJOR 5)
set(CPACK_PACKAGE_VERSION_MINOR 7)
set(CPACK_PACKAGE_VERSION_PATCH 1)

set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The Scientific Plotting Library
PLplot")
set(CPACK_PACKAGE_VENDOR "PLplot development team")
set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_CURRENT_SOURCE_DIR}/README)
set(CPACK_GENERATOR TGZ)
set(
CPACK_SOURCE_PACKAGE_FILE_NAME
"plplot-${VERSION}"
CACHE INTERNAL "tarball basename"
)
set(CPACK_SOURCE_GENERATOR TGZ)
# The following components are regex's to match anywhere (unless anchored)
# in absolute path + filename to find files or directories to be excluded
# from source tarball.
set(CPACK_SOURCE_IGNORE_FILES
"~$"
"\\\\.cvsignore$"
"^${PROJECT_SOURCE_DIR}.*/CVS/"
"^${PROJECT_SOURCE_DIR}/debian/"
"^${PROJECT_SOURCE_DIR}/old/"
)
#message("CPACK_SOURCE_IGNORE_FILES = ${CPACK_SOURCE_IGNORE_FILES}")
include(CPack)

After running cmake and make, the "make package_source" command works great
to generate a source release tarball (excluding those files in the source
tree mentioned in CPACK_SOURCE_IGNORE_FILES).  However, recently I have
tried "make package", and there is something wrong with the above because
I get a short compressed file of 1024 NULL characters rather than
a tarball.

Here is the message that is generated from "make package"

many stanzas of Nothing to be done messages of which I leave the last one...

make -f utils/CMakeFiles/pltek.dir/build.make 
utils/CMakeFiles/pltek.dir/preinstall
make[2]: Entering directory /home/software/plplot_cvs/HEAD/build_dir'
make[2]: Nothing to be done for utils/CMakeFiles/pltek.dir/preinstall'.
make[2]: Leaving directory /home/software/plplot_cvs/HEAD/build_dir'
make[1]: Leaving directory /home/software/plplot_cvs/HEAD/build_dir'

Then the meat of trying to use cpack...

Run CPack packaging tool...
/home/software/cmake/install/bin/cpack --config
/home/software/plplot_cvs/HEAD/build_dir/CPackConfig.cmake
CPack: Create package using TGZ
CPack: Install projects
CPack: - Run preinstall target for: plplot
CPack: - Install project: plplot
CPack: Compress package
CPack: Finalize package
CPack: Package
/home/software/plplot_cvs/HEAD/build_dir/plplot-5.7.1-Linux.tar.gz generated.

So all seems to be well except for the little problem that the generated
plplot-5.7.1-Linux.tar.gz files is really a compressed version of 1024 NULL
characters rather than the desired binary release tarball output.

Can anybody spot anything I am missing in setting the CPACK-related
variables above?  I attach the resulting CPackConfig.cmake (generated with
the CPACK_PACKAGE_EXECUTABLES addition below) if that will help anybody to
figure this out.

When I try the same thing for the cmake source, then "make package" works
fine (i.e., it generates an actual tarball of what ordinarily would go into
the install tree.) There are some CPACK related variables set in the
top-level CMakeLists.txt file that are set for cmake (such as
CPACK_PACKAGE_EXECUTABLES), but I cannot figure out their exact purpose.
For example, I tried setting

set(CPACK_PACKAGE_EXECUTABLES "plplotd;PLplot library")

(plplotd is the target name used for our principal library), but it made no
difference to the NULL file result.  Could anybody explain the purpose of
CPACK_PACKAGE_EXECUTABLES?

I should also mention a file called install_manifest.txt which is generated
each time I try "make package" which is filled with the names of files that
ordinarily would be installed.

I will attach that file as well.

Thanks in advance for any help you can give me.

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 Yorick front-end to PLplot (yplot.sf.net); the
Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________
-------------- next part --------------
# This file will be configured to contain variables for CPack. These variables
# should be set in the CMake list file of the project before CPack module is
# included. Example variables are:
#   CPACK_GENERATOR                     - Generator used to create package
#   CPACK_INSTALL_CMAKE_PROJECTS        - For each project (path, name, component)
#   CPACK_CMAKE_GENERATOR               - CMake Generator used for the projects
#   CPACK_INSTALL_COMMANDS              - Extra commands to install components
#   CPACK_INSTALL_DIRECTORIES           - Extra directories to install
#   CPACK_PACKAGE_DESCRIPTION_FILE      - Description file for the package
#   CPACK_PACKAGE_DESCRIPTION_SUMMARY   - Summary of the package
#   CPACK_PACKAGE_EXECUTABLES           - List of pairs of executables and labels
#   CPACK_PACKAGE_FILE_NAME             - Name of the package generated
#   CPACK_PACKAGE_ICON                  - Icon used for the package
#   CPACK_PACKAGE_INSTALL_DIRECTORY     - Name of directory for the installer
#   CPACK_PACKAGE_NAME                  - Package project name
#   CPACK_PACKAGE_VENDOR                - Package project vendor
#   CPACK_PACKAGE_VERSION               - Package project version
#   CPACK_PACKAGE_VERSION_MAJOR         - Package project version (major)
#   CPACK_PACKAGE_VERSION_MINOR         - Package project version (minor)
#   CPACK_PACKAGE_VERSION_PATCH         - Package project version (patch)

# There are certain generator specific ones

# NSIS Generator:
#   CPACK_PACKAGE_INSTALL_REGISTRY_KEY  - Name of the registry key for the installer
#   CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS - Extra commands used during uninstall
#   CPACK_NSIS_EXTRA_INSTALL_COMMANDS   - Extra commands used during install


SET(CPACK_CMAKE_GENERATOR "Unix Makefiles")
SET(CPACK_GENERATOR "TGZ")
SET(CPACK_INSTALL_CMAKE_PROJECTS "/home/software/plplot_cvs/HEAD/build_dir;plplot;ALL;/")
SET(CPACK_MODULE_PATH "/home/software/plplot_cvs/HEAD/plplot_cmake/cmake/modules")
SET(CPACK_NSIS_DISPLAY_NAME "plplot 5.7.1")
SET(CPACK_OUTPUT_CONFIG_FILE "/home/software/plplot_cvs/HEAD/build_dir/CPackConfig.cmake")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "/home/software/plplot_cvs/HEAD/plplot_cmake/README")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The Scientific Plotting Library PLplot")
SET(CPACK_PACKAGE_EXECUTABLES "plplotd;PLplot library")
SET(CPACK_PACKAGE_FILE_NAME "plplot-5.7.1-Linux")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "plplot 5.7.1")
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "plplot 5.7.1")
SET(CPACK_PACKAGE_NAME "plplot")
SET(CPACK_PACKAGE_VENDOR "PLplot development team")
SET(CPACK_PACKAGE_VERSION "5.7.1")
SET(CPACK_PACKAGE_VERSION_MAJOR "5")
SET(CPACK_PACKAGE_VERSION_MINOR "7")
SET(CPACK_PACKAGE_VERSION_PATCH "1")
SET(CPACK_RESOURCE_FILE_LICENSE "/home/software/cmake/install/share/cmake-2.4/Templates/CPack.GenericLicense.txt")
SET(CPACK_RESOURCE_FILE_README "/home/software/cmake/install/share/cmake-2.4/Templates/CPack.GenericDescription.txt")
SET(CPACK_RESOURCE_FILE_WELCOME "/home/software/cmake/install/share/cmake-2.4/Templates/CPack.GenericWelcome.txt")
SET(CPACK_SOURCE_GENERATOR "TGZ")
SET(CPACK_SOURCE_IGNORE_FILES "~$;\\.cvsignore$;^/home/software/plplot_cvs/HEAD/plplot_cmake.*/CVS/;^/home/software/plplot_cvs/HEAD/plplot_cmake/debian/;^/home/software/plplot_cvs/HEAD/plplot_cmake/old/")
SET(CPACK_SOURCE_OUTPUT_CONFIG_FILE "/home/software/plplot_cvs/HEAD/build_dir/CPackSourceConfig.cmake")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "plplot-5.7.1")
SET(CPACK_SYSTEM_NAME "Linux")
SET(CPACK_TOPLEVEL_TAG "Linux")


More information about the CMake mailing list