[CMake] Really Basic Question

Alan W. Irwin irwin at beluga.phys.uvic.ca
Wed Apr 18 20:47:32 EDT 2007


On 2007-04-18 23:41-0000 dfeustel at mindspring.com wrote:

> I created a CMakeLists.txt file with the following:
>
>
> # set a list of items
>
> SET(items_to_buy apple orange pear beer)
>
> # loop over the items
>
> FOREACH (item $(items_to_buy))
> 	MESSAGE( "Don't forget to buy a $(item)" )
> ENDFOREACH (item $(items_to_buy))
> MESSAGE( $(items_to_buy) )
>
> when I run either ccmake . or cmake, ther is no expansion
> of $(items_to_buy). Do I need something else in the file?

Yes, variable expansion requires curly braces and not parentheses:

$(items_to_buy) ==> ${items_to_buy}

Alan

__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list