[CMake] [CMake/CPack] empty debian package

Eric Noulard eric.noulard at gmail.com
Thu Mar 27 14:34:20 EDT 2008


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.

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

>
> SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "An spectacular shell
> script")
>  SET(CPACK_PACKAGE_VENDOR "Me")
> SET(CPACK_GENERATOR DEB)
> SET(CPACK_PACKAGE_NAME ${PACKAGE_NAME})
> SET(CPACK_PACKAGE_VERSION ${PACKAGE_VERSION})
> SET(CPACK_PACKAGE_FILE_NAME
> "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
>  SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
> SET(CPACK_SOURCE_PACKAGE_FILE_NAME
> "${CPACK_PACKAGE_NAME}-${PACKAGE_VERSION}-src")
> SET(CPACK_SOURCE_IGNORE_FILES
> "CMakeFiles;\\\\.tar\\\\.gz$;/_CPack_Packages/;CMakeCache;\\\\.o$;\\\\.so$;/CVS/;/\\\\.svn/;\\\\.swp$;\\\\.#;/#;.*~;cscope.*")
>  SET(CPACK_PACKAGE_CONTACT "me at myplace.com")
>
> #
> # .rpm and .deb packaging tools
> #
> SET(CPACK_DEB "ON")
>  INCLUDE(CPack)
>
>
>
> after a "cmake ." call,
>
> a "make package-source" provides me a correct source package.
>
> but a "make package" provides me an empty debian files.
>
> Thanks in advance for your expertise.
>
> Jérôme


-- 
Erk


More information about the CMake mailing list