[CMake] VS2005 emitter and /vmg compiler option: bug?

Brandon Van Every bvanevery at gmail.com
Fri Nov 23 13:02:14 EST 2007


On Nov 23, 2007 11:59 AM, Theodore Omtzigt <theo at stillwater-sc.com> wrote:
>
> When I try to force the run-time as follows:
>
> set( CMAKE_CXX_FLAGS_DEBUG /vmg /MDd)
>
>
>
> The compiler command line adds a ";" to the /vmg and thus changes the switch
> to a meaningless string for VS and I am back to non-compiling code due to
> the /vmg being missing.

Try
set( CMAKE_CXX_FLAGS_DEBUG "/vmg /MDd")

The problem is that whitespace separated items are interpreted as a
list.  In CMake, a list is stored as a string of semicolon-separated
list elements.

String, list, and quote behavior is one of those "chapter topic"
issues that unfortunately, isn't documented because we don't have
chapter-oriented documentation.  I suppose that people with energy
could write "chapter topics" on the wiki, but what happens in the real
world is, once you've learned this stuff you tend to not care anymore.
 It's the classic programmer vs. documenter dilemma.  That said, I'm
adding a FAQ entry about this.

Is all this written up nicely in the "Mastering CMake" book?  I've
never read it.  I learned CMake by hacking.


Cheers,
Brandon Van Every


More information about the CMake mailing list