[CMake] CPack: Add PATH to .profile

Andreas Mohr andi at lisas.de
Sat Sep 28 14:26:50 EDT 2013


Hi,

On Sat, Sep 28, 2013 at 12:00:04PM -0400, cmake-request at cmake.org wrote:
> Date: Fri, 27 Sep 2013 20:20:06 +0200
> From: Eric Noulard <eric.noulard at gmail.com>
> Subject: Re: [CMake] CPack: Add PATH to .profile


> 2013/9/27 Michele Dolfi <dolfimeth at gmail.com>:
> > Using install(SCRIPT ...) in CMake the patch my own .profile, not the one of
> > the user installing my app.
> 
> Yes you want a "post-install" script.
> With PackageMaker you have the
> CPACK_PREFLIGHT_SCRIPT
> CPACK_POSTFLIGHT_SCRIPT
> 
> which may be used to do that but I don't know how they works
> and whether if they are "selectable" at install time.

Perhaps you're thinking in terms of explicit installer-side activation
of execution of these scripts.
But that's not necessarily necessary ;)

A convincing workaround would be to have these scripts executed
*unconditionally*, and then these would simply check whether a marker
is available (perhaps marker file stored on a temp fs).
So, IOW, the installer option would only need to have the capability
of creating those marker signals somehow (in case the user selected the
corresponding option),
then the unconditionally executed scripts would react on those (not) existing.

HTH,

Andreas Mohr


More information about the CMake mailing list