[CMake] -D option and value with equals sign

Tyler Roscoe tyler at cryptio.net
Sat Jun 27 14:21:40 EDT 2009


On Sat, Jun 27, 2009 at 10:34:34AM -0700, Gregory Sharp wrote:
> gsharp at stonesmith:~/projects/plastimatch$ cat myscript.cmake
> MESSAGE("FOO is ${FOO}")
> gsharp at stonesmith:~/projects/plastimatch$ cmake -DFOO=bar -P myscript.cmake
> FOO is bar
> gsharp at stonesmith:~/projects/plastimatch$ cmake -DFOO=bar=baz -P myscript.cmake
> FOO is 
> gsharp at stonesmith:~/projects/plastimatch$ cmake -DFOO="bar=baz" -P myscript.cmake
> FOO is 
> gsharp at stonesmith:~/projects/plastimatch$ cmake -DFOO=bar\=baz -P myscript.cmake
> FOO is 
> gsharp at stonesmith:~/projects/plastimatch$ cmake -DFOO="bar\=baz" -P myscript.cmake
> FOO is 

Interesting. Looks like a bug to me.

What are you actually trying to do? The only thing I can think of is to
split the clause into two separate variables. 

Your CMakeLists would have ${foo1}=${foo2} and then from the command line do cmake -Dfoo1=bar -Dfoo2=baz. Kinda ugly but maybe it unblocks you? The real CMake developers don't check their list mail over the weekend, so you're stuck with me for now :).

tyler


More information about the CMake mailing list