[CMake] Escaping equal sign in custom command

David Cole dlrdave at aol.com
Thu Apr 11 10:02:34 EDT 2013


Try:


    cmake -D "DOXYGEN_TAGFILES:STRING=C:/bar/somevalue=C:/foo/another" -P configure_file.cmake


Because of the “:TYPE” parsing, “:” after the = sign can sometimes be misinterpreted by the regex code used to parse these out...



HTH,

David




From: Robert Dailey
Sent: ‎Thursday‎, ‎April‎ ‎11‎, ‎2013 ‎10‎:‎02‎ ‎AM
To: CMake

Actually I did a bit more testing on this:

C:\Work\rdailey-hp\dpd-cmake\cmake\scripts\cmake>cmake -D
"DOXYGEN_TAGFILES=C:/bar/somevalue=C:/foo/another" -P configur
e_file.cmake
DOXYGEN_TAGFILES:

C:\Work\rdailey-hp\dpd-cmake\cmake\scripts\cmake>cmake -D
"DOXYGEN_TAGFILES=C/bar/somevalue=C:/foo/another" -P configure
_file.cmake
DOXYGEN_TAGFILES: C/bar/somevalue=C:/foo/another

The only difference in both cases is that I have removed the first
occurance of ":" (colon), which occurs after DOXYGEN_TAGFILES=. Why
would this cause the variable to not be defined??

On Thu, Apr 11, 2013 at 8:52 AM, Robert Dailey <rcdailey.lists at gmail.com> wrote:
> 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.
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130411/c2770195/attachment.htm>


More information about the CMake mailing list