[CMake] Generating archives and binaries with different PREFIX settings using CPack

Eric Noulard eric.noulard at gmail.com
Mon Apr 25 17:35:59 EDT 2011


2011/4/25 Clifford Yapp <cliffyapp at gmail.com>:
> Eric,
>
> Thanks - that looks like it will do the trick, testing now.  Is there
> a bug report somewhere proposing using CMake-level per-generator
> variables to control these things?

AFAIK there aren't any.

Now adding this for ALL CPack generators would honestly be a pain
because you'll have to do it in EVERY generator...and redo it each time
you add/remove a CPACK_xxx generic var.

We may try to design something like CPack generator specific generic overload
which could be done by the CPack generator base class once for all.

Something like:
if CPACK_<GEN>_WHATEVER is defined then
CPACK_WHATEVER will automatically be overidden by
CPACK_<GEN>_WHATEVER content.


e.g.
set(CPACK_DEB_PACKAGING_INSTALL_PREFIX "/opt")
would trigger
set(CPACK_PACKAGING_INSTALL_PREFIX "/opt")

before DEB generator has a chance to run.
This is pretty much what is achieved with my example of CPack config
project file.

Note however that doing a lot of
set(CPACK_<GEN>_xxx ...) does not seems like a good idea to me.
Mixing CPack time informations with CMake time ones is not that nice.

I would rather suggest to continue to use the CPack config project file
with the set(CPACK_<GEN>_xxx ...) inside.


-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list