[Vm-dev] issue with cmake

David T. Lewis lewis at mail.msen.com
Fri Jan 22 12:56:22 UTC 2010


On Fri, Jan 22, 2010 at 01:49:01PM +0100, Levente Uzonyi wrote:
> 
> On Fri, 22 Jan 2010, Levente Uzonyi wrote:
> 
> >
> >On Thu, 21 Jan 2010, John McIntosh wrote:
> >
> >>maybe some can explain the magic, or fix the script?
> >
> >There's a bug in platforms/unix/CMakeLists.txt. At line 29, there's
> >   STRING (REGEX REPLACE "OPT--(.*)" "\\1" var ${opt})
> >This line splits the arguments in an unexpected way.
> >If you replace the next line
> >  MESSAGE (STATUS "Setting ${var}=${${opt}}")
> >with
> >  MESSAGE (STATUS "Setting ${var} to ${${opt}}")
> >the error will be obvious.
> >CFLAGS will be unset, so it will fall back to the default.
> 
> It turned out to be a CMake bug/feature.
> If opt contains an = character, say opt is "foo=bar" then ${opt} will be 
> "foo" and ${$opt} will be "bar". If opt contains more than one = 
> character, the last will count (dumb, dumb, dumb...), so if opt is 
> "CFLAGS=-O3 -march=native" then $opt will be "CFLAGS=-O3 -march" and 
> ${$opt} will be "native".

Levente,

Wow, nice debugging! Thanks.



More information about the Vm-dev mailing list