Re: [cmake-developers] Test for list size

2018-12-12 Thread Brad King via cmake-developers
On 12/12/18 7:01 AM, Torsten Robitzki wrote:
> 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

I've almost never needed to test the length of a list.
What are you trying to do?

-Brad
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake-developers


[cmake-developers] Test for list size

2018-12-12 Thread Torsten Robitzki
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




signature.asc
Description: Message signed with OpenPGP
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake-developers