[CMake] some comments on the LIST command

Alexander Neundorf a.neundorf-work at gmx.net
Thu May 11 15:43:29 EDT 2006


Hi, 
 
> Von: Andy Cedilnik <andy.cedilnik at kitware.com> 
>  
> Hi Alex, 
>  
> Alexander Neundorf wrote: 
>  
> >yesterday I played a bit with the new LIST command in 2.4.1, and here 
are 
> >some comments:  
... 
> >-in the docs the list variable is sometimes called LIST and sometimes  
> >called VAR  
> >   
> > 
> They should all be really a list variable. So, you cannot say: 
>  
> LIST(LENGTH "foo;bar" var) 
>  
> and expect to get 2. 
 
While this would be also nice, this isn't what I meant. 
I just noticed that in the documentation the list variable is sometimes 
called "list" and sometimes called "variable": 
LIST(LENGTH <list> <output variable>)  
vs. 
LIST(REVERSE <variable>) 
 
> >-why does an access beyond the end of the list fail with a cmake 
error ?  
> >I would have expected to get an empty or FALSE or NOTFOUND value. This  
> >would make using it easier  
> >   
> > 
> Should it fail gracefully? What should be the indicator? 
 
Returning a "false"-value, e.g. "ITEM_NOTFOUND" or something like this. 
  
> >-the LIST command does not work on ARGN. Is this intentional ?  
> >   
> > 
> ARGN is special for now because of the way macros are handled. To use 
it  
> do this: 
>  
> SET(myarray ${ARGN}) 
> LIST(.... myarray ...) 
 
Yes, I did this. But it felt like a workaround for something which should 
actually work. 
  
> > -why is LIST( SET ...) not called LIST(APPEND ... ) ?  
> >   
> > 
> I added APPEND. I may take LIST(SET out. 
>  
> > -is LIST(SET mySrcs foo.cpp) faster than SET(mySrcs ${mySrcs} 
foo.cpp) ? 
> >   
> > 
> List SET/APPEND appends, while SET justs sets to the value. 
 
Ok, I'll do some benchmarking. 
 
Bye 
Alex 
 

-- 
Echte DSL-Flatrate dauerhaft für 0,- Euro*!
"Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl


More information about the CMake mailing list