[CMake] [CPack] Creating .deb package
Eric Noulard
eric.noulard at gmail.com
Wed Apr 11 11:37:25 EDT 2007
2007/4/11, Mathieu Malaterre <mathieu.malaterre at gmail.com>:
> Hello there,
>
> I am currently looking to create .deb (debian package) for a project
> using CMake. As far as I understand I have two options:
>
> 1. Use dh_make and follow a couple of steps so that dh_make(*) will
> drive the build of the package, or
>
> 2. The structure of a .deb package is fairly simple (**). Which make
> is very close to a .tgz generated by CPack (+ some text file,
> everything archive in a single file). I would simply need to add some
> post cpack operation to archieve this.
>
> Anyone else has done a CMake2Deb script ?
I don't know for .deb but I'm really interested in what you
will do (and may help/test if useful).
Personnally I would go for option 1) and keep it CMake scripts.
I think option 2) may lead you to C++ code of CPack which is
a valuable (may be more powerful) option, but I think it would
be more painful to maintain/debug/update.
I did something "similar" to opiotn 1) for RPM:
1) Run cpack for generating .tgz (source or binary)
2) Run custom command in order to create
(or use an home-brewed) RPM .spec file
3) Run rpmbuild tools which use .tgz and .spec
You end up adding something like:
INCLUDE(CPack)
INCLUDE(UseRPMTools)
IF(RPMTools_FOUND)
RPMTools_ADD_RPM_TARGETS(${PROJECT_NAME})
ENDIF(RPMTools_FOUND)
to your CMakeLists.txt and you get 2 makefile (custom) target
named:
${PROJECT_NAME}_rpm
and
${PROJECT_NAME}_srpm
You may look at the following file if you want to see detail:
http://cvs.savannah.nongnu.org/viewcvs/tsp/make/UseRPMTools.cmake?root=tsp&view=markup
hope this helps
--
Erk
More information about the CMake
mailing list