[CMake] More than one package source for a project.

Eric Noulard eric.noulard at gmail.com
Fri Jun 15 14:24:18 EDT 2012


2012/6/15 Darryl L. Pierce <dpierce at redhat.com>:
> On Fri, Jun 15, 2012 at 03:30:02PM +0200, Eric Noulard wrote:
>> > Specifically what I want to do is put the subset of sources into a separate
>> > gzipped tarball rather than it create an RPM (we have an official workflow
>> > for RPM creation on the distro side of things).
>>
>> You should be able to do that using custom made
>> CPack config files and appropriate value for
>> CPACK_INSTALLED_DIRECTORIES.
>>
>> then invoke cpack -G TGZ --config <YourConfigFile>
>>
>>
>> you may invoke cpack from a custom command.
>
> I took a look at the default file created for our project. Which lines
> can I prune from the file?

Many of them.
all CPACK_BINARY_* may be removed.
all CPACK_SOURCE_* may be removed as well
(in fact they should contains the same values as their  CPACK_* equivalent).

Then depending on generator you use some others may be removed as well.
You can find the role of a particular var using:

cpack --help-variable CPACK_XXXX

if you encounter invalid documentation or undocumented variable
please file a bug report, the CPack doc is relatively new and may be
sparse.

> And can I pass in the
> CPACK_INSTALLED_DIRECTORIES value in the command line?

Should work if it is not defined in the config file.
cpack -D CPACK_INSTALLED_DIRECTORIES="/path/to/source;/grafpoint"
--config CPackYourConfig.cmake


-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org


More information about the CMake mailing list