View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006868CMakeCMakepublic2008-04-22 05:432008-04-29 16:11
ReporterAlejandro Morell García 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake-2-6 
Target VersionFixed in Version 
Summary0006868: Stdout redirecting fails when using VERBATIM option in ADD_CUSTOM_COMMAND
DescriptionWhen 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>
        ...
Additional InformationThe 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
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0011589)
Brad King (manager)
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

 Issue History
Date Modified Username Field Change
2008-04-22 05:43 Alejandro Morell García New Issue
2008-04-22 09:03 Bill Hoffman Status new => assigned
2008-04-22 09:03 Bill Hoffman Assigned To => Brad King
2008-04-29 15:36 Brad King Note Added: 0011589
2008-04-29 16:11 Brad King Status assigned => closed
2008-04-29 16:11 Brad King Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team