[cmake-developers] Test for list size

Torsten Robitzki Torsten at Robitzki.de
Wed Dec 12 07:01:41 EST 2018


Hi,
we have often the need to test for a minimum list size

  list(LENGTH list list_size)
  if (list_size GREATER 1)
  …

This happens so much, that we though it might be helpful to extend the if-syntax to allow this to be written in a more compact way. For example:

  if (LENGTH list GREATER 1)
  …

Or maybe by introducing functions that can return values (length being a „function“ here):

  if (length[list] GREATER 1)
  …

What do you think? Are we the only ones that could make good use out of this extension?

best regards,

Torsten


-------------- 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/20181212/a6e29299/attachment.sig>


More information about the cmake-developers mailing list