[CMake] ok guys, why is configure_file() so sucky?

Andreas Mohr andi at lisas.de
Wed Aug 17 10:17:37 EDT 2011


[cue maximally inflammatory subject ;)]

Hi,

I keep encountering template file processing where
@VAR@ replacements end up empty due to the required template
variable simply not having been set (or empty) [or renamed away].
Doh.

I'd strongly vote for configure_file() to fail hard in such cases,
_by default_.
Build system life is already hard enough without all those nice
"features" of incomplete/insufficient commands (especially in the
packaging area I seem to keep hitting more holes
than actual functionality :-P).

So:
- change configure_file() behaviour to fail a CMake configure run hard
  in case of unavailable (_not_ "empty") @var@ (and perhaps ${var}?),
  and have this be the _default_ setting
- add configure_file() flag to optionally _disable_ this hard failure
  in case it's actually unwanted
- add configure_file() flag to optionally enable hard failure for the
  other case of existing yet empty variables, too
- add policy around this new highly useful feature
- hmm, but these things {w|sh}ould apply to both ${xx} and @xx@ - do we need
  to have some configuration to tell behaviour apart?
- anything I've missed that should be added/changed for a more suitable
  implementation?
- add these things to a new bug# for implementation

Done Deal?

Thanks,

Andreas Mohr


More information about the CMake mailing list