[Cmake] Looping over numbers

Wheeler, Fred (Research) wheeler at crd.ge.com
Tue Feb 4 13:40:03 EST 2003


FYI, the Unix 'seq' command provides a good model for this kind of functionality.

Fred Wheeler



SEQ(1)                           User Commands                          SEQ(1)



NAME
       seq - print a sequence of numbers

SYNOPSIS
       seq [OPTION]... LAST
       seq [OPTION]... FIRST LAST
       seq [OPTION]... FIRST INCREMENT LAST

DESCRIPTION
       Print numbers from FIRST to LAST, in steps of INCREMENT.

       -f, --format=FORMAT
              use printf style floating-point FORMAT (default: %g)

       -s, --separator=STRING
              use STRING to separate numbers (default: \n)

       -w, --equal-width
              equalize width by padding with leading zeroes

       --help display this help and exit

       --version
              output version information and exit

       If  FIRST or INCREMENT is omitted, it defaults to 1.  FIRST, INCREMENT,
       and LAST are interpreted as floating point values.  INCREMENT should be
       positive  if  FIRST is smaller than LAST, and negative otherwise.  When
       given, the FORMAT argument must contain  exactly  one  of  the  printf-
       style, floating point output formats %e, %f, %g

AUTHOR
       Written by Ulrich Drepper.

REPORTING BUGS
       Report bugs to <bug-sh-utils at gnu.org>.

COPYRIGHT
       Copyright (C) 2002 Free Software Foundation, Inc.
       This is free software; see the source for copying conditions.  There is
       NO warranty; not even for MERCHANTABILITY or FITNESS FOR  A  PARTICULAR
       PURPOSE.

SEE ALSO
       The  full  documentation for seq is maintained as a Texinfo manual.  If
       the info and seq programs are properly installed at your site, the com-
       mand

              info seq

       should give you access to the complete manual.



seq (sh-utils) 2.0.15             August 2002                           SEQ(1)



> -----Original Message-----
> From: Andy Cedilnik [mailto:andy.cedilnik at kitware.com]
> Sent: Tuesday, February 04, 2003 1:37 PM
> To: John Biddiscombe
> Cc: CMake
> Subject: RE: [Cmake] Looping over numbers
> 
> 
> Hi John,
> 
> How about keep range the way I said before and add as a part of STRING
> command something like:
> 
> STRING(FORMAT VARIABLE "%d" 5)
> 
> Though, this would add new syntax.
> 
> 				Andy
> 
> On Tue, 2003-02-04 at 12:34, John Biddiscombe wrote:
> > Good plan. How about
> > 
> > RANGE(var 1 20 "%02i")
> > 
> > Adding a printf type option for output, because it'd be 
> nice to generate
> > 01 02 03 04 as well as 1 2 3 4 to give better sorting on 
> the dashboard.
> > 
> > RANGE(var 1 20 "File%02i") <-handy for file names too
> > 
> > I'll try and create one when I have a few hours free.
> > 
> > JB
> 
> _______________________________________________
> Cmake mailing list
> Cmake at public.kitware.com
> http://public.kitware.com/mailman/listinfo/cmake
> 



More information about the CMake mailing list