[CMake] CPack: Building Multiple Packages

Stuart Herring cmake at stuartherring.com
Fri Apr 4 20:39:04 EDT 2008


On Fri, Apr 4, 2008 at 6:14 AM, Bill Hoffman <bill.hoffman at kitware.com> wrote:
>  I think you can create a CPackConfig.cmake file for each and run cpack on
> them directly and it should work. make package won't do the right thing, but
> you should be able to create cpack input files for as many parts of a system
> as you want.

This is what I do - it seems to work, but it took a bit of figuring out.

Attached is the script I use to package our product.  it defines a
macro "ADD_COMPONENT_PACKAGE(component)" where component is a
COMPONENT as passed to the INSTALL command - so you just call that
macro once for each component you want to create a package for.
A target is created for each package with the name
PACKAGE_${component}, and there is an ALL_PACKAGES target to build
them all.
If you use this script, then make sure you don't also include CPack.cmake.

I have also attached the CPackConfig.in file I use, for reference.

Regards,
Stuart.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Packaging.cmake
Type: application/octet-stream
Size: 952 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080405/f734659c/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CPackConfig.in
Type: application/octet-stream
Size: 1169 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080405/f734659c/attachment-0001.obj>


More information about the CMake mailing list