[cmake-developers] Alternate if() without implicit variable expansion

Brad King brad.king at kitware.com
Thu Sep 4 11:53:51 EDT 2014


On 09/04/2014 11:41 AM, Nils Gladitz wrote:
> I assume the fact that arguments were quoted would have to be preserved 
> and the implementation of all existing commands touched so that they can 
> actually make use of that information (even if only if() would currently 
> make use of it).

Most commands just implement InitialPass, which gets the expanded
arguments.  Some implement InvokeInitialPass which gets the args
before expansion.  The cmIfCommand does this already, and its
call to cmMakefile::ExpandArguments could be updated to request
the additional information.  Other commands should not need to
be modified.

The cmMakefile::ExpandArguments method's output will have to provide
the information.  I'm not sure whether all call sites need it or not,
but it could simply be implemented as a second argument of type
"vector<cmListFileArgument::Delimiter>* = 0" to be populated with
the same number of entries as the original argument.  Or, a second
signature of vector<CommandArg> could be created to pair each output
argument string with its delimiter type.  Then cmIfCommand could use
that internally.

-Brad




More information about the cmake-developers mailing list