[CMake] Re: [cmake 2.5 CVS] CMAKE_${LANG}_FLAGS is initialized with space

Brandon Van Every bvanevery at gmail.com
Fri Dec 14 17:17:53 EST 2007


On Dec 14, 2007 3:01 PM, Rodolfo Schulz de Lima <rodolfo at rodsoft.org> wrote:
> Bill Hoffman escreveu:
> > OK, Dave Cole, just pointed out that list is the wrong thing to use
> > here. The CMAKE_C_FLAGS variable is supposed to be a string and not a
> > list.   If you used list(APPEND more than once it would always fail. So,
> > although odd that it has a space in it, it is benign.  You should treat
> > the variable as a string and not a list.
>
> I really thought it was a list of flags. What if a flag has an argument
> with a space? For instance,
> -I/home/rodolfo lima

Congrats, you've discovered that certain aspects of CMake aren't
actually list oriented.  This is the kind of reason we need Chapter
Oriented documentation, to explain these nuances of lists, strings,
quotes, and escapes.  For compatibility reasons, I don't think
overhauling the string-oriented variables to make them list-oriented
is feasible.  And in one's own code, one has to choose whether to
embrace a string-oriented or list-oriented flag handling style.  More
grist for the chapter.


Cheers,
Brandon Van Every


More information about the CMake mailing list