[CMake] CPack Generator-specific install commands

Eric Noulard eric.noulard at gmail.com
Fri Mar 29 16:30:02 EDT 2013


2013/3/29 John Bruce <jbruce at barracuda.com>

> Hello,****
>
> ** **
>
> I have a project that I’m packaging both as a DEB file and a tgz file.
> I’ve included all necessary install() commands in my CMakeLists.txt, and
> have specified “DEB;TGZ” as the generators for CPack. ****
>
> ** **
>
> I understand that if I want to include generator-specific CPack commands,
> I’ll have to include them in a Cpack_Project_config_file, which I have done
> as well. However, I’m not able to include install() commands in this file
> for some reason.
>

Install command are "CMaket-time" commands, i.e. they run when CMake runs.
Cpack_Project_config_file may only contain CPack-time command because it
gets read when CPack runs.

If you want to include/exclude some part of your files/target in a specific
installer you should
**always** provide install command in your CMakeLists.txt but use the
COMPONENT argument
of this command.

Then use/override CPACK_COMPONENTS_ALL in your Cpack_Project_config_file so
that
only the component you want are installed.

 see doc:
cpack  --help-variable CPACK_COMPONENTS_ALL

> I’d like to include an additional file in only the tgz package. Is there a
> way to do this (without resorting to post-cmake/cpack scripting)?
>

So yes, COMPONENTized install should makes it possible.


-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130329/84ed7d6c/attachment-0001.htm>


More information about the CMake mailing list