[CMake] -D option and value with equals sign

Gregory Sharp gregsharp.geo at yahoo.com
Sun Jun 28 01:21:55 EDT 2009


> > 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 :).

Thank you for checking.  :)

I was trying to pass in the command line arguments for an executable 
that cmake will invoke.  But I found that the executable accepts 
spaces as well as equal sign, so no worries in the end.

This is now logged as bug #0009214.

Best Regards,
-Greg



      


More information about the CMake mailing list