[CMake] How to work around permission deficiencies of file(GENERATE...)? (was cmp0026, file(GENERATE...), and configure_file)

Alan W. Irwin irwin at beluga.phys.uvic.ca
Wed Apr 29 22:17:06 EDT 2015


On 2015-04-29 20:36-0400 David Cole wrote:

> It seems like a reasonable feature request to me to ask for
> file(GENERATE to support a similar or sub-set of permissions related
> options which other file subcommands already provide:
>
>    [FILE_PERMISSIONS <permissions>...]
>    [NO_SOURCE_PERMISSIONS] [USE_SOURCE_PERMISSIONS]
>
> Doesn't seem like it should be that hard to add support incrementally
> for that feature...

I did notice those options for file(COPY...) and making those
available for file(GENERATE...) as well sounds like a good idea in
general.

However, until that is implemented (or configure_file(GENERATE ...) is
implemented with the usual configure_file permission semantics which
just copies the permissions of the source file) I need a method of
setting file permissions at generate time.  Is there currently _any_
way to do that under CMake?

If the answer is "no", then for now I am going to have to use some
ugly permission fixups at build time for a use case (configured
executable script that needs to know the location of a different
executable in the build tree) that is likely not that uncommon.  So
either I am missing some obvious method of setting permissions at
generate-time or other projects with that use case have likely been
sticking with CMP0026 OLD.  I don't plan to go back to CMP0026 OLD
myself since the argument for possible location bugs for that case
make sense to me.  At the same time though, I think it is fair to say
CMP0026 NEW has certainly not been a smooth experience for me.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list