MantisBT - CMake
View Issue Details
0006868CMakeCMakepublic2008-04-22 05:432008-04-29 16:11
Alejandro Morell García 
Brad King 
normalminoralways
closedfixed 
CMake-2-6 
 
0006868: Stdout redirecting fails when using VERBATIM option in ADD_CUSTOM_COMMAND
When using VERBATIM option, >> operator is quoted and executed program parses it as a file instead of redirecting output.

This can avoided not using VERBATIM but documentation says it will default option in future.

This operator would be a good future option in COMMAND. For example:
   ADD_CUSTOM_COMMAND(OUTPUT <output1>
        COMMAND <cmd> <arg1> ... OUTPUT_FILE <stdout_file>
        ...
The following:
ADD_CUSTOM_COMMAND(OUTPUT gstmarshal.c
> COMMAND ${CMAKE_COMMAND} -E copy gstmarshal.c.template gstmarshal.c
> COMMAND glib-genmarshal --body --prefix=gst_marshal
> ${CMAKE_CURRENT_SOURCE_DIR}/gstmarshal.list >> gstmarshal.c
> WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/gst/
> COMMENT "Generating flex and bison parsers" VERBATIM
> )

Generates this line in Makefile:
 cd
> /home/alejandro/Proyectos/gstreamer/gstreamer-0.10.19/build/gst/
> && glib-genmarshal --body --prefix=gst_marshal
> /home/alejandro/Proyectos/gstreamer/gstreamer-0.10.19/gst/gstmarshal.list
> ">>" gstmarshal.c

Note how the >> operator is quoted and parsed by glib-genmarshal as a file instead of redirecting stdout to gstmarshal.c file
No tags attached.
Issue History
2008-04-22 05:43Alejandro Morell GarcíaNew Issue
2008-04-22 09:03Bill HoffmanStatusnew => assigned
2008-04-22 09:03Bill HoffmanAssigned To => Brad King
2008-04-29 15:36Brad KingNote Added: 0011589
2008-04-29 16:11Brad KingStatusassigned => closed
2008-04-29 16:11Brad KingResolutionopen => fixed

Notes
(0011589)
Brad King   
2008-04-29 15:36   
I think the shell redirection operators should not be escaped even by VERBATIM. No one creates tools that expect arguments like '>' to work simply because shells provide the operators.

/cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v <-- Source/cmLocalGenerator.cxx
new revision: 1.273; previous revision: 1.272