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

Torsten at Robitzki.de Torsten at Robitzki.de
Tue Jan 22 03:08:36 EST 2019


Hi Brad,

> Am 14.01.2019 um 12:44 schrieb Brad King <brad.king at kitware.com>:
> 
> I've almost never needed to test the length of a list in CMake
> code.  It's not very common in my experience.  What is your
> customer trying to do?

Sorry for the late response! I’ve asked him. Mainly, he has three use cases:

- Checking for empty lists (I’ve showed him that this can be done by a string compare).
- Checking for lists having more than 1 entry
- Checking for equal size of two lists. For example, if you want to pass pairs or tuples to a function. (example: f(firsts seconds))

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/20190122/e0e8f2ba/attachment.sig>


More information about the cmake-developers mailing list