[CMake] Creating two distinct packages w/ CPack from a single project

Eric Noulard eric.noulard at gmail.com
Wed Oct 25 05:34:16 EDT 2017


2017-10-24 9:33 GMT+02:00 Eric Noulard <eric.noulard at gmail.com>:

>
>
> Le 16 oct. 2017 23:54, "J. Paul Reed" <preed at releng-approaches.com> a
> écrit :
>
>
> Hey all,
>
> I have a (potentially?) odd situation: I need to generate multiple packages
> using CPack from the same CMake project.
>
> [...]

>
> I see where this message() gets emitted
> (https://gitlab.kitware.com/cmake/cmake/blob/master/Modules/
> CPack.cmake#L298-302);
> perusing that file, it seems to do things I basically want/need (setting
> various defaults, etc.) if I want to use cpack with a different config
> file.
>
>
> Hi there,
> As you already discovered I was the author of this warning some years ago
> when I was actively working on CPack. The reason for this was to make it
> clear that even include(CPack) may look (and somehow behave) like a
> function call creating a CPack config set of files. It is not. It wasn't
> designed for that usage and it may generate weird content on a second (or
> more) inclusion.
> Some people were occasionally bitten by that.
> e.g. since it inspects variable (in the current scope which was initially
> global) beginning with CPACK_ prefix for doing its work, when you use it
> twice it does not ensure or cleanup variables that may be there due to the
> first inclusion. This would be up to the user to clean leftover before
> successive inclusion.
>
> To summarize, this is a pure macro processing, not a function call.
>
> It would be nice to have a cpack_xxx function which safely implements the
> behaviour you seek. That was on my wishlist some time  but I never get the
> time to implement it. (There may be some old mantis bug report for that
> wish, I'll dig into it and come back here if I find something interesting).
>

After some digging I found that the issue on gitlab is this one,
https://gitlab.kitware.com/cmake/cmake/issues/1075.
It refers to the original Mantis issue years ago. I guess that the feature
(multiple CPack calls) may be useful to some CPack users.
I have no time to work on this but I put the ref here in order to make the
reference accessible.


-- 
Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20171025/c4c7c903/attachment.html>


More information about the CMake mailing list