[Cmake] howto sort a cmake list ?

Andy Cedilnik` andy.cedilnik at kitware.com
Sat, 21 Feb 2004 11:03:29 -0500


Hi Mike,

I would be much happier if sorting would be a part of some more generic
command. I was thinking about a VECTOR command, which would perform operations
on vectors. 

Then we could have things like:

VECTOR(SORT [NUMERIC] var ${list} ${list} item ...)
VECTOR(LENGTH var ${list} ...)
VECTOR(REVERSE var ${list} ...)
VECTOR(RETRIEVE var index ${list} ...)

or something similar. There is too many specific commands in CMake already and
they need some cleaning.

        Andy

On Sat, 21 Feb 2004 16:22:01 +0100
"Michael T. Wagner" <mtw at shared-reality.com> wrote:

> I've managed to add the SORT command, it works like this:
> SORT(CTRLGUI_SRC ASC), CTRLGUI_SRC is a variable containing the list of
> filenames to be sorted, you can specify ASC or DESC to specify the sort
> order. I've looked into the  vc7 generator code but didnt find the place
> to put the code so I ended up adding the command which was quite
> straight forward) Anyway, I've attached the source if you want to
> consider adding it somewhere.