[CMake] [CMake/CPack] empty debian package

Alexander Neundorf a.neundorf-work at gmx.net
Thu Mar 27 19:51:55 EDT 2008


On Thursday 27 March 2008, Eric Noulard wrote:
> 2008/3/27, Jerome Arbez-Gindre <jerome.arbez-gindre at laposte.net>:
> > Hi,
>
> Hi there :-)
>
> > I am using the CVS version of CMake and I would like to use CMake only
> > for its Packaging capabilities.
>
> If you "only" want to package things you may
> well only use CPack without CMake, It should be possible if you craft
> your own CPack[XXXX]Config.cmake file
> and then call
>
> cpack --config CPack[XXXX]Config.cmake
>
> I did not tried it so I don't really know how it should work
> since CPack needs something like "make install" for "pseudo-installing
> the project".
>
> > My project consists on only one bash script (which is not compile ;-)
> > called for example "myscript".
>
> I think you may be missing 2 things:
>
> First the beginning of your CMakeLists.txt should include a PROJECT
> statement
>
> PROJECT(myscript)
>
> > SET(PACKAGE_NAME myscript)
> > SET(PACKAGE_VERSION 1.0)
> >
> > #
> > # Cpack configuration
> > #
> > INSTALL(PROGRAMS myscript
> >     DESTINATION ${CMAKE_INSTALL_PREFIX}/sbin)
>
> This install command should be rewritten with relative path:
>
> INSTALL(PROGRAMS myscript DESTINATION sbin)
>
> As far as I know CPack does NOT chroot before "make install"
> but only use something like:
>
> DESTDIR=${CMAKE_BINARY_DIR}/_CPack_Packages/<system>/<GEN>
> make install
>
> so if you INSTALL(..) something using ABSOLUTE path name you won't
> get those files in your package.

If you use install() with an absolute path DESTDIR is still honored on "make 
install".
But I just tried and while it works with "make install", it doesn't when 
creating the packages, not only for deb, but lso for the other formats.

> This may be worth a feature request (or a patch :-).

This actually sounds more like a cpack bug with absolute paths.

Alex


More information about the CMake mailing list