[CMake] Launching a script after user picks components in component-based installers

Eric Noulard eric.noulard at gmail.com
Sun Jul 3 12:13:59 EDT 2011


2011/7/3 Mathias Gaunard <mathias.gaunard at ens-lyon.org>:
> With a component-based installer such as NSIS, the user can choose the
> components that he wants to install.
>
> I would need to launch a script (just launching an external program would
> do) after this, telling me where the application was installed, so that I
> can perform additional actions depending on which components were installed
> or so I can autoconfigure the application according to the system settings.
>
> Does CMake/CPack allow to do something like this?
>
> I see that RPM appears to allow to specify a shell script for post install,
> but I'd like to have something that works for all component-based CPack
> generators, and all operating systems.

The post-install step currently depends on the CPack generator you use.

Doing such thing in a portable/cross-platform way would need to suppose
you have a portable tool at hand **AT INSTALL TIME**.

It would be logical to require CMake and may be embbed a CMake script
like in the
INSTALL(SCRIPT <file> ...)
Note that if you do this you'll get packages that require more than today,
since currently you may install your binary DEB or RPM or NSIS
even if CMake is not installed


Whatever the solution one would need the support for the packaging system
(RPM, DEB, NSIS, ...) which makes it possible to execute something at
install time.
This is doable with RPM, DEB, I'm pretty sure it should be possible
with NSIS too
(but I'm no NSIS expert), however most archive generators (ZIP, TGZ,
TBZ2, ...) won't
provide enough support for that.



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


More information about the CMake mailing list