Filip Brcic wrote:

Yes, and for increased readability, I would suggest you to use:

add_definitions(-DFOO="\\"foo\\"")

so that you get

gcc -DFOO="\"foo\"" yourfile.c

when CMake compiles your file and, obviously, FOO="foo" in C.

On the sidenote, how does that relate to various shells? I'm using bash, but did anybody cases with escapes like this one in other shells such as csh, zsh, {,d}ash, or Micro$oft's favourite - ksh?
Of course a better way to do that IMO, is to configure a file.

#cmakedefine FOO "@somevalue@"

That way there are no shell issues.

-bill

_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to