[CMake] CPack general question and example

David Doria daviddoria at gmail.com
Mon Nov 15 21:54:57 EST 2010


> 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


CPack Error: Problem running tar command: "/usr/bin/cmake" -E tar cfz
control.tar.gz ./control ./md5sums
Please check /home/doriad/CPackTest/bin/_CPack_Packages/Linux/DEB/Deb.log
for errors
CPack Error: Problem compressing the directory
CPack Error: Error when generating package: DistanceBetweenPoints
make: *** [package] Error 1

I am using:
doriad at davidlaptop:~/CPackTest/bin$ cmake --version
cmake version 2.8.1

Also, I see that there is an example of BundleUtilities to bundle Qt.
I will take a look at that tomorrow. Is the same possible for VTK?

Thanks,

David


More information about the CMake mailing list