[CMake] WRITE_FILE and special char

Tristan Carel tristan.carel at gmail.com
Wed Nov 8 09:46:51 EST 2006

On 11/8/06, Xavier Larrode <Xavier.Larrode at irisa.fr> wrote:
> Hi all
> How can i write special character like ${} with WRITE_FILE
> ex : Libs:  -L${libdir} -lcairo
> and libdir is not a cmake variable...

WRITE_FILE(${PROJECT_SOURCE_DIR}/foo.txt "Libs:  -L\${libdir} -lcairo")

Note the \ character before $ to tell CMake we want the character so
that it prevents the variable expansion.

Tristan Carel
Music with dinner is an insult both to the cook and the violinist.

More information about the CMake mailing list