[CMake] CPACK_MONOLITHIC_INSTALL not handled at runtime?

Vladislav Vaintroub vvaintroub at googlemail.com
Sun Nov 14 17:23:47 EST 2010



> -----Original Message-----
> From: Eric Noulard [mailto:eric.noulard at gmail.com]
> Sent: Sunday, November 14, 2010 9:43 PM
> To: Vladislav Vaintroub
> Cc: CMake ML
> Subject: Re: [CMake] CPACK_MONOLITHIC_INSTALL not handled at runtime?
> 
> 2010/11/14 Vladislav Vaintroub <vvaintroub at googlemail.com>:
> >
> > [skip]
> >> 1) Shall we step back and may be setup a CMake policy for
> >>     enabling component installer?
> >>     If we go for a policy may be someone can help me with this
> >>     because I did never add a new policy mayself.
> >
> > Sounds like a good idea. On the other hand, just assuming CPACK_MONOLITHIC_INSTALL=1  by default for
> > archives (ZIP, TGZ) and produce
> > components only if explicitly  requested with CPACK_MONOLITHIC_INSTALL=0 would be fine with me.
> > I imagine, this is what many users would want, but I might be mistaken.
> 
> Ok I think the idea is good but I propose some slightly more elaborate scheme.
> 
> Each CPackGenerator may support or not component install.
> Now it's not because a generator is able to produce "componentized" package that
> it should be it's default behavior (even if the user specified
> COMPONENT in its CMakeLists.txt)
> 
> Thus for each generator which support component install there is an associated
> default behavior which is to go either way.
> 
> If a user wants to enforce the non default behavior (either way) it may do so
> by setting
> 
> CPACK_<GENERATOR>_MONOLITHIC_INSTALL
> CPACK_<GENERATOR>_COMPONENT_INSTALL
> or
> CPACK_<GENERATOR>_INSTALL_BEHAVIOR=MONOLITHIC
> CPACK_<GENERATOR>_INSTALL_BEHAVIOR=COMPONENT
> 
> we need both because default behavior for existing installer are
> or will be differents (NSIS vs ZIP).
> 
> 
> if ones want to GLOBALLY enforce either way then:
> 
> CPACK_MONOLITHIC_INSTALL
> CPACK_COMPONENT_INSTALL
> or
> CPACK_INSTALL_BEHAVIOR=MONOLITHIC
> CPACK_INSTALL_BEHAVIOR=COMPONENT
> could be set.
> 
> Non component-aware generator will ignore those
> (as of today).
> 
> Those vars may be set at CMake-time or at CPack-time.
> 
> What do you think?

Yes, sounds like a good idea, it allows the most flexibility.   Re. variables , I guess  CPACK_MONOLITHIC_INSTALL={ON|OFF} and
CPACK_<GENERATOR>_MONOLITHIC_INSTALL ={ON|OFF} would already cover all possible scenarios.  I.e MONOLITHIC_INSTALL=OFF  is the same
as component install = ON, right?

> I personnally think this scheme is relatively simple and robust
> and it would be easy to maintain backward compatibility without
> even have to introduce a new cmake policy.
> 
> --
> Erk
> Membre de l'April - « promouvoir et défendre le logiciel libre » -
> http://www.april.org



More information about the CMake mailing list