[cmake-developers] Making the default install component name configurable
Eric Noulard
eric.noulard at gmail.com
Sun May 13 13:44:22 EDT 2012
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.
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.
All that said if the user plays with default component name, we may
required to set all
defaults values related to the default component.
--
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org
More information about the cmake-developers
mailing list