[CMake] [Patch] 7z cpack generator support

Ralf Habacker ralf.habacker at freenet.de
Tue Apr 21 07:12:43 EDT 2009


Hi,

for a specific cmake project on windows there was 7zip cpack support 
requested. The appended patch adds those support to cpack.

It works like the zip generator with one extension: It is possible to 
run 7z with additional options by defining the (newly introduced) 
CPACK_GENERATOR_7Z_OPTIONS variable.

Options could be usefull for example to set an archive password or to 
choose the sfx mode and so on. The following example snippet shows how 
to create an sfx archive

set(CPACK_GENERATOR "7z")
set(CPACK_GENERATOR_7Z_OPTIONS "-sfx")
set(CPACK_OUTPUT_FILE_PATH 
"${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${PRODUCT_VERSION}.exe")

The next example snippet shows how to set an archive password.

set(CPACK_GENERATOR "7z")
set(CPACK_GENERATOR_7Z_OPTIONS "-papassword")

It would be nice if this patch could be applied to the cmake repository 
to have it in further releases.

Regards
 Ralf
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cmake-7zip-generator.patch
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090421/8fb5009a/attachment-0001.asc>


More information about the CMake mailing list