[CMake] CPack general question and example

Eric Noulard eric.noulard at gmail.com
Mon Nov 15 17:04:59 EST 2010


2010/11/15 David Doria <daviddoria at gmail.com>:
> I just heard about CPack and started playing with it.

Which version of CMake/CPack are you using?

> I tried to make an RPM of a simple VTK program:
>
> http://www.cmake.org/Wiki/CMake/CPackExample
>
> When I run 'make package', I get an error:
>
> CPack Error: Problem copying the package:
> /home/doriad/CPackTest/bin/_CPack_Packages/Linux/RPM/DistanceBetweenPoints-0.1.1-Linux.rpm
> to /home/doriad/CPackTest/bin/DistanceBetweenPoints-0.1.1-Linux.rpm
> CPack Error: Error when generating package: DistanceBetweenPoints
> make: *** [package] Error 1
>
> If I leave out the
> SET(CPACK_GENERATOR "RPM")

More information about CPack RPM (and others) is there:
http://www.vtk.org/Wiki/CMake:CPackPackageGenerators

> line, there are no errors, but the .tar.gz file that is created seems
> to be empty. Am I missing something?

Yes probably,
CPack will package objects (FILE, TARGET, etc..) which are found
in INSTALL rules?
Do you have INSTALL statements in your CMakeLists.txt

> On a bigger question - what can I expect to be contained in the RPM?
> EVERYTHING required to run my program (which will include all of VTK
> (or at least the required bits?))? I'm just trying to get a handle on
> when and why I would want to do this.

Nope.
You won't get the dependency automatically (at least not with current CPack RPM)

You may look at BundleUtilities CMake module for that purpose, but
I don't know how far it can go.


-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list