[CMake] cpack question
Eric Noulard
eric.noulard at gmail.com
Wed Jan 31 10:17:59 EST 2007
2007/1/30, Alexander Neundorf <a.neundorf-work at gmx.net>:
> Hi,
>
> today I tried cpack for the first time, it just worked :-)
>
> One question:
> in the tar.gz and .sh files the install always ends up in projectname-versionnumber/.
> I tried setting CPACK_PACKAGE_INSTALL_DIRECTORY to /usr/local/, but the tgz didn't seem to honor this flag.
> Bug or feature ?
Don't know but I would guess for a feature.
I think
CPACK_PACKAGE_INSTALL_DIRECTORY may not be used as you think
by the TGZ generator. I know that we use it on the NSIS (Windows) generator
and this is the install path the tool suggest when you run the installer.
Nevertheless, it's usually a bad idea to build a tar with absolute path name
because you may not be able to untar at this exact ABSOLUTE location.
GNU tar on linux will not even allow it :
>>
tar zcvf tt.tgz /tmp/mydir
tar: Retrait de « / » de tête des noms des membres
>>
(sorry my Linux is french localized)
Moreover I think that if you want to install your tar.gz in /usr/local
you may do
cd /usr/local
tar --strip-components 1 zxvf you_archive.tgz
the strip components (may be GNU tar only option though)
will remove the top level folder
and you'll get what you want (I think).
--
Erk
More information about the CMake
mailing list