[cmake-developers] real functions (was: $LIST_LENGTH{} syntax)

Torsten at Robitzki.de Torsten at Robitzki.de
Tue Jan 22 10:28:55 EST 2019



> Am 22.01.2019 um 13:33 schrieb Brad King <brad.king at kitware.com>:
> 
> On 1/22/19 7:09 AM, Torsten at Robitzki.de wrote:
> 
>> How about adding the ability to add such function? Like:
>> 
>> procedure(LIST_LENGTH list)
>>  list(LENGTH list length)
>>  return(${length})
>> endprocedure()
> 
> We don't have a syntax for invoking functions with return values.
> That’s a whole other discussion.

With `$CACHE{VAR}` and `$ENV{VAR}` we already have the syntax for calling a „function“. What is missing, is a command to define a function and a command to specify the return value of a function.

Once we have this, it would be possible to define $LIST_LENGTH in the CMake language itself. And real functions with return values could make writing in CMake language much more easier.

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


More information about the cmake-developers mailing list