[CMake] CPack ZIP generator: is there a way to avoid a root directory named ${CPACK_PACKAGE_FILE_NAME} in the zip?

Massaro Alessio Alessio.Massaro at mediobanca.co.uk
Tue Feb 14 03:55:44 EST 2012


That did it nice and clean.
THANK YOU VERY MUCH!

-----Original Message-----
From: Eric Noulard [mailto:eric.noulard at gmail.com] 
Sent: 13 February 2012 23:33
To: Massaro Alessio
Cc: cmake at cmake.org
Subject: Re: [CMake] CPack ZIP generator: is there a way to avoid a root directory named ${CPACK_PACKAGE_FILE_NAME} in the zip?

2012/2/13 Massaro Alessio <Alessio.Massaro at mediobanca.co.uk>:
> Hi there
>
>
>
> The CPack ZIP generator seems to always put all "installed" files in a 
> directory called ${CPACK_PACKAGE_FILE_NAME}
>
> So, if ${CPACK_PACKAGE_FILE_NAME}=="xyz", the zip file will have one 
> single "xyz" directory at the root, with all "installed" files placed therein.
>
>
>
> Does anyone know if there's a way to switch off this behavior and have 
> everything zipped at the root of the zip file? (so no "xyz" directory 
> containing everything)

try
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0)

it should do what you want.

PS: you can try on the command line as well

 cpack -D CPACK_INCLUDE_TOPLEVEL_DIRECTORY=0 -G ZIP



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


More information about the CMake mailing list