[cmake-developers] Support for list length expression in if()-command?

Torsten at Robitzki.de Torsten at Robitzki.de
Tue Jan 22 07:09:00 EST 2019



> Am 22.01.2019 um 12:42 schrieb Brad King <brad.king at kitware.com>:
> 
> 
> Rather than a special `if` syntax, perhaps we could introduce an
> explicit `$LIST_LENGTH{mylist}` syntax.  One would need to experiment
> to see if modifying the variable expansion parser (under CMP0053 NEW
> behavior only) to support this would have a significant performance
> impact.

What would be a good experiment setup? Timing the CMake configuration process itself (I mean the time it takes the configuration step, when building CMake with CMake).

How about adding the ability to add such function? Like:

procedure(LIST_LENGTH list)
  list(LENGTH list length)
  return(${length})
endprocedure()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <https://cmake.org/pipermail/cmake-developers/attachments/20190122/baf1d4db/attachment.sig>


More information about the cmake-developers mailing list