[CMake] Small, complete CPack example?

Eric Noulard eric.noulard at gmail.com
Fri Aug 6 07:22:49 EDT 2010


2010/8/6 Chris Wolf <cw10025 at gmail.com>:
>
> e.g for :  install(TARGETS usb LIBRARY DESTINATION lib)
>
> (where project name is "libusb")
>
> The CPack-generated TGZ archive will contain:
> libusb-0.1.1-Darwin/lib/libusb.dylib
>
> ...this, regardless of the setting of CPACK_INCLUDE_TOPLEVEL_DIRECTORY!
>
> (I would have expected set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0)
>  to result in the archive to contain: ./lib/libusb.dylib)

This is the case on my box (Linux Debian Squeeze x86_64),
I can strip off the prefix if I do:

cpack -D CPACK_INCLUDE_TOPLEVEL_DIRECTORY=0 -G TGZ
or
if I set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0)

Which version of CMake are you using on which platform?
May be it's a bug.

> Another observation regarding the CPack-generated *.pkg
> (wrapped in a *.dmg) :
>
> The path is prefixed by "./usr", somehow:
>
> (assuming the *.dmg is already mounted)
> $ cd ./libusb-0.1.1-Darwin.pkg/Contents
> $ lsbom -s Archive.bom
> .
> ./usr
> ./usr/lib
> ./usr/lib/libusb.dylib
>
> So where does the "./usr/" prefix come from?

I'm do not know the dmg CPack Generator
(is it PackageMaker or DragNDrop?)
 and I'm not a mac user but each CPack generator has a default
"builtin" CPACK_PACKAGING_INSTALL_PREFIX.

Try
set(CPACK_PACKAGING_INSTALL_PREFIX. "/whatever")


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


More information about the CMake mailing list