[CMake] cpack -G DEB for subdirectories

Eric Noulard eric.noulard at gmail.com
Fri Jan 30 08:37:27 EST 2009


2009/1/30 BlinkEye <gentoo at blinkeye.ch>:
> Hello
>
> I seem not able to find an example of how to generate .deb files with cpack for
> different subdirectories of a project. Is this possible and if so, how?

As far as I know CPack only handles a single per-project package,
i.e. you may easilly build a package (deb, rpm, tgz etc...) for the WHOLE
project, even if the project does have subdirectories.
CPack will package all target, files etc... which are

INSTALL(TARGET ...
INSTALL(FILES ...
etc...

There is a possibility to use the COMPONENT feature:
http://www.cmake.org/Wiki/CMake:Component_Install_With_CPack,
in order to build different package using different CMake build options
but as far as I know DEB generator does not
currently handle COMPONENT:
http://www.cmake.org/Wiki/CMake:Component_Install_With_CPack#Ideas_for_Future_Development


So if you want a single deb package you may add whatever needed INSTALL command
in every subdirectory you want and it should work.
If you want several deb I would say you either need to split your
project in several projects
or submit a patch for the DEB generator :-)

-- 
Erk


More information about the CMake mailing list