<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
I'm trying to convert the following script into CMake
add_custom_command:<br>
<br>
<font face="Courier New, Courier, monospace"> echo #include
"glib-object.h" > gstmarshal.c.tmp<br>
echo #include "gstmarshal.h" >> gstmarshal.c.tmp<br>
glib-genmarshal --body --prefix=gst_marshal
..\..\gst\gstmarshal.list >> gstmarshal.c.tmp<br>
move gstmarshal.c.tmp ..\..\gst\gstmarshal.c<br>
echo #include "gst/gstconfig.h" > gstmarshal.h.tmp<br>
glib-genmarshal --header --prefix=gst_marshal
..\..\gst\gstmarshal.list >> gstmarshal.h.tmp<br>
move gstmarshal.h.tmp ..\..\gst\gstmarshal.h</font><br>
<br>
That I translated in a more simple "cmake script":<br>
<br>
<font face="Courier New, Courier, monospace"> FILE(WRITE
${CMAKE_BINARY_DIR}/gst/gstmarshal.c.template<br>
"#include \"glib-object.h\"" "\n" "#include \"gstmarshal.h\""
"\n")<br>
<br>
ADD_CUSTOM_COMMAND(OUTPUT gstmarshal.c<br>
COMMAND ${CMAKE_COMMAND} -E copy gstmarshal.c.template
gstmarshal.c<br>
COMMAND glib-genmarshal --body --prefix=gst_marshal
${CMAKE_CURRENT_SOURCE_DIR}/gstmarshal.list >> gstmarshal.c<br>
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/gst/<br>
COMMENT "Generating flex and bison parsers" VERBATIM<br>
)<br>
<br>
</font>If I create a linux makefile, the make fails with:<br>
<br>
<font face="Courier New, Courier, monospace">(process:11394):
GLib-Genmarshal-WARNING **: failed to open ">>": No such file or
directory<br>
</font><br>
and all stdout from glib-genmarshal is echoed in terminal.<br>
<br>
Inspecting Makefile, the problem seems this (file
gst/CMakeFiles/libgstreamer.dir/build.make):<br>
<br>
<font face="Courier New, Courier, monospace">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</font><br>
<font face="Courier New, Courier, monospace"><br>
</font>Cmake coutes >> operator, so no redirecting is done.<br>
<br>
Someone knows how to avoid this?<br>
<br>
</body>
</html>