[CMake] CMake LIST Command: Wiki changes and LIST patch.

Alexander Neundorf a.neundorf-work at gmx.net
Wed Aug 15 10:34:04 EDT 2007


On Monday 25 June 2007 17:56, Miguel A. Figueroa-Villanueva wrote:
> Hello everyone,
>
> I have made some changes to the wiki page on lists
> (http://www.cmake.org/Wiki/CMakeMacroListOperations) to reflect the
> new LIST command in CMake 2.4+. I hope I have presented the changes in
> an appropriate way.
>
> There is one macro in the wiki page that the current LIST command
> couldn't support, the LIST_CONTAINS. This macro provides a
> functionality that I believe is quite useful and is in line with the
> other LIST command operations. As such, I went ahead and implemented
> it in my cmake source tree and have provided a patch for it below. The
> changes add the following functionality:
>
>   LIST
>        List operations.
>
>          LIST(CONTAINS <list> <value> <output variable>)
>
>        CONTAINS will return TRUE if the element specified is in the list.

I removed LIST(CONTAINS ) again from cvs (it was in no release yet) and 
replaced it with LIST(FIND ...), so you get the index of them item or -1 if 
it wasn't found. This is more useful, e.g. when writing macros with optional 
keywords which take parameters.

Alex


More information about the CMake mailing list