[CMake] Question about vars

Brad King brad.king at kitware.com
Mon Sep 25 10:05:55 EDT 2006


Joshua Blocher wrote:
> I'm having trouble with variables, anytime i use a variable with
> gtk+-2.0 (i.e. gtk+-2.0_CFLAGS comes up cmake chokes on it and splits
> out (see below) is this because i have non-alphanumeric characters in
> them.
[snip]
> syntax error, unexpected cal_SYMBOL, expecting } (18), when parsing
> string "${gtk+-2.0_CFLAGS}"
> 
> include(UsePkgConfig)
> SET(2GEOM_DEPENDS gtk+-2.0 cairo gsl blas)
> FOREACH(dep ${2GEOM_DEPENDS})
>    PKGCONFIG(${dep} ${dep}_INCLUDE_DIR ${dep}_LINK_DIR
> ${dep}_LINK_FLAGS ${dep}_CFLAGS)

CMake variables are supposed to support valid file names to allow things
like this.  It looks like the regex to parse variable names when ${${}}
syntax support was added did not include the + character.  I've fixed
this in CVS CMake and the fix will be in 2.4.4.

-Brad


More information about the CMake mailing list