[CMake] CPack general question and example

Reinhard Thies Reinhard.Thies at web.de
Tue Nov 16 02:14:38 EST 2010


Hi David,
On Tuesday 16 November 2010 03:54:57 David Doria wrote:
> > You need  INSTALL commands for everything you want to be in the package
> > 
> > For your example:
> > 
> > ADD_EXECUTABLE(DistanceBetweenPoints DistanceBetweenPoints.cxx)
> > INSTALL(TARGETS DistanceBetweenPoints DESTINATION bin) # Add this for
> > CPack to work
> > 
> > Then both "make install" and "make package" will work , and there will be
> > bin directory in the package  with DistanceBetweenPoints executable in
> > it.
> > 
> > Vladislav
> 
> Thanks for the quick replies. After adding the INSTALL command, 'make
> install' works as expected. 'make package' created an rpm. When I ran
> 
> rpm -ihv file.rpm
> 
> it told me to use alien to convert it to a .deb (Ubuntu 10.03).
> Instead, I changed the cpack generator to DEB. When I then ran 'make
> package', I got some errors:
> 
> doriad at davidlaptop:~/CPackTest/bin$ make package
> [100%] Built target DistanceBetweenPoints
> Run CPack packaging tool...
> CPack: Create package using DEB
> CPack: Install projects
> CPack: - Run preinstall target for: DistanceBetweenPoints
> CPack: - Install project: DistanceBetweenPoints
> CPack: Compress package
> CMake Error at /usr/share/cmake-2.8/Modules/CPackDeb.cmake:119 (MESSAGE):
>   Debian package requires a maintainer for a package, set
>   CPACK_PACKAGE_CONTACT or CPACK_DEBIAN_PACKAGE_MAINTAINER

its telling you what to do !
You should have a look at 
http://www.vtk.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29
because there are some more variables to set

--  
regards Reinhard


More information about the CMake mailing list