[cmake-developers] Making the default install component name configurable

Alexander Neundorf neundorf at kde.org
Sun May 13 14:15:19 EDT 2012


On Sunday 13 May 2012, Eric Noulard wrote:
> 2012/5/13 Alexander Neundorf <neundorf at kde.org>:
> > Hi,
> > 
> > the install() command has a COMPONENT argument.
> > 
> > If this is not used, such unnamed components are always named
> > "Unspecified".
> > 
> > In the MakeDefaultInstallComponentNameConfigurable branch on stage I
> > added a new cmake variable CMAKE_DEFAULT_INSTALL_COMPONENT_NAME, which
> > is now used instead. It is initialized to "Unspecified", so if nobody
> > does anything, everything stays as it was.
> > 
> > But if needed, this variable can now be set to something project-specific
> > or directory specific.
> > 
> > Comments ?
> 
> This looks like a nice feature.
> It will have a may-be unoticeable side-effect with CPack.

That's why I CC'd you :-)

> Currently CPack.cmake do automatically require the default component
> to be installed (if specified in CPACK_COMPONENTS_ALL) .
> You can see that, because you have:
> Modules/CPack.cmake:set(CPACK_COMPONENT_UNSPECIFIED_HIDDEN TRUE)
> Modules/CPack.cmake:set(CPACK_COMPONENT_UNSPECIFIED_REQUIRED TRUE)
> 
> As soon as the user do change the default component he/she will loose
> this "automatic" behavior and shall
> set(CPACK_COMPONENT_<compName>_REQUIRED TRUE)
> in order to get back this behavior.
> 
> We could patch CPack.cmake in the case where
> CMAKE_DEFAULT_INSTALL_COMPONENT_NAME is
> set globally but if it is set on a per-directory basis then it would
> be up to the user to set
> CPACK_COMPONENT_<compName>_XXXX variables with appropriate value.

I think this should be ok.
I mean, everything where the project does not change the 
CMAKE_DEFAULT_INSTALL_COMPONENT_NAME variable is still in "Unspecified", so 
this is still the default.
And everything else has been set explicitely by the user, so it should be ok 
if he has the set the respective cpack variables, I think.

Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20120513/7a0f6790/attachment.html>


More information about the cmake-developers mailing list