Hendrik Sattler
2009-05-19 21:29:09 UTC
Hi,
either I cannot find it or it's not there: doing simple mathematic things like
substract 1 from a variable.
If that's not present, I do not understand how
LIST( LENGTH MYLIST COUNT )
FOREACH ( index RANGE ${COUNT} )
list ( GET MYLIST ${index} entry )
....
will address non-present indexes in the list. I would the above statement
cover the range from 0 to COUNT-1 but it also cover COUNT itself like said in
the documentation. Does that actually make sense as the variable in the
documentation is called "total" but the loop count is "total+1"?
Currently I use a
if ( LESS )
work-around but that looks like a hack.
Any ideas?
HS
either I cannot find it or it's not there: doing simple mathematic things like
substract 1 from a variable.
If that's not present, I do not understand how
LIST( LENGTH MYLIST COUNT )
FOREACH ( index RANGE ${COUNT} )
list ( GET MYLIST ${index} entry )
....
will address non-present indexes in the list. I would the above statement
cover the range from 0 to COUNT-1 but it also cover COUNT itself like said in
the documentation. Does that actually make sense as the variable in the
documentation is called "total" but the loop count is "total+1"?
Currently I use a
if ( LESS )
work-around but that looks like a hack.
Any ideas?
HS