[CMake] -D option and value with equals sign

Gregory Sharp gregsharp.geo at yahoo.com
Sat Jun 27 13:34:34 EDT 2009


> > cmake -Dfoo="bar=baz" -P myscript.cmake
> > 
> > The value does not seem to be transmitted to my
> script.
> 
> What value is transmitted to your script?

The variable is empty (see below for example).  This is on linux, 
with cmake 2.6.4.

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 



      


More information about the CMake mailing list