[CMake] Removing the first element from a list

Sylvain Benner benner at virtools.com
Thu Oct 11 11:16:07 EDT 2007


> How does one go about removing the first element of a list
Have a look to the LIST command, you'll have everything you need.

  LIST
       List operations.

         LIST(LENGTH <list> <output variable>)
         LIST(GET <list> <element index> [<element index> ...] <output 
variable>
)
         LIST(APPEND <list> <element> [<element> ...])
         LIST(INSERT <list> <element_index> <element> [<element> ...])
         LIST(REMOVE_ITEM <list> <value> [<value> ...])
         LIST(REMOVE_AT <list> <index> [<index> ...])
         LIST(SORT <list>)
         LIST(REVERSE <list>)

       LENGTH will return a given list's length.

       GET will return list of elements specified by indices from the list.

       APPEND will append elements to the list.

       INSERT will insert elements to the list to the specified location.

       When specifying an index, negative value corresponds to index 
from the
       end of the list.

       REMOVE_AT and REMOVE_ITEM will remove item from the list.  The
       difference is that REMOVE_ITEM will remove the given items, while
       REMOVE_AT will remove the item at the given indices.

--Sylvain


More information about the CMake mailing list