[CMake] Escaping equal sign in custom command
Robert Dailey
rcdailey.lists at gmail.com
Thu Apr 11 09:52:16 EDT 2013
I'm invoking cmake -P to execute a CMake script in a custom command,
and I also pass in variables via -D. Here is the command that gets
generated by CMake for the custom command:
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -D
IN_FILE=C:/Work/rdailey-hp/dpd-cmake/server/gmmserver/domino/server/gwserver/doxygen_config.dox
-D OUT_FILE=C:/Work/rdailey-hp/dpd-cmake/build-vc9/output/documentation/gddomconnector/config.dox
-D DOXYGEN_OUTPUT_DIRECTORY=\"C:/Work/rdailey-hp/dpd-cmake/build-vc9/output/documentation/gddomconnector\"
-D DOXYGEN_GENERATE_TAGFILE=\"C:/Work/rdailey-hp/dpd-cmake/build-vc9/output/documentation/gddomconnector/doxygen.tag\"
-D "DOXYGEN_TAGFILES=C:/Work/rdailey-hp/dpd-cmake/build-vc9/output/documentation/gddominoaccess/doxygen.tag\=C:/Work/rdailey-hp/dpd-cmake/build-vc9/output/documentation/gddominoaccess/html
" -P C:/Work/rdailey-hp/dpd-cmake/cmake/scripts/cmake/configure_file.cmake
The problem is the equal sign for the DOXYGEN_TAGFILES variable I'm
defining. If I insert an equal sign (I try to escape it with literal
'\' and also without), the variable DOXYGEN_TAGFILES does not get
defined inside the script. If I only remove the equal sign, then the
variable gets defined.
How can I do this properly? I'm running this command inside Visual
Studio, but I also paste it directly into a command prompt in Windows
to test it, doesn't work there either.
For the DOXYGEN_TAGFILES variable, here is how I generate that part of
the custom command in my CMake code:
set( dependency_tagfiles
"${dep_output_dir}/doxygen.tag\\=${dep_output_dir}/html "
)
The above variable is passed directly into add_custom_command in the
ARGS field, after being appended to literal "DOXYGEN_TAGFILES="...
Thanks in advance.
More information about the CMake
mailing list