[CMake] CPack packages are missing files

Eric Noulard eric.noulard at gmail.com
Sat Mar 20 18:20:18 EDT 2010


2010/3/20 Rob Hasselbaum <rob at hasselbaum.net>:
> Hi all,
>
> I'm trying to use CPack to generate packages for my Linux-based
> project (version 2.6), but what I'm finding is that some files are
> missing from the output package regardless of what generator I try.

Which one did you try?
RPM, TGZ, ZIP ?

> Specifically, executables, shared libraries, and resources files
> passed through the "configure_file" command seem to work OK, but
> unaltered text files and icons do not.
>
> I understand that CPack only packages what was installed. In my case,
> I am calling the "install" command for all of the files in question
> and "make install" installs them just fine,

when you do "make install" are you root or normal user?
Are you installing files in absolute location or relatively to your
install prefix?

> so it's just the package
> generation that isn't working. Also, if I run CPack as non-root, I see
> two errors for each file that wasn't installed. Here's one example:
>
> CMake Error at /home/rob/dev/socketsentry/build/socketsentry-service/cmake_install.cmake:50
> (FILE):
>  file INSTALL cannot set permissions on
>  "/etc/dbus-1/system.d/org.socketsentry.Watcher.conf"
> Call Stack (most recent call first):
>  /home/rob/dev/socketsentry/build/cmake_install.cmake:37 (INCLUDE)
>
> CMake Error at /home/rob/dev/socketsentry/build/cmake_install.cmake:51 (FILE):
>  file Internal CMake error when trying to open file:
>  /home/rob/dev/socketsentry/build/install_manifest.txt for writing.
>
> If I run CPack as root, I don't see the errors, but the files are
> missing from the output package. Any ideas?

You must be installing file with absolute pathname destination.
If you do so you should:

1) try to avoid absolute pathname destination

or

2) SET(CPACK_SET_DESTDIR ON) in your CMakeLists.txt

see:
http://www.cmake.org/pipermail/cmake/2008-July/022958.html
-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list