<!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">&nbsp;&nbsp;&nbsp; echo #include
"glib-object.h" &gt; gstmarshal.c.tmp<br>
&nbsp;&nbsp;&nbsp; echo #include "gstmarshal.h" &gt;&gt; gstmarshal.c.tmp<br>
&nbsp;&nbsp;&nbsp; glib-genmarshal --body --prefix=gst_marshal
..\..\gst\gstmarshal.list &gt;&gt; gstmarshal.c.tmp<br>
&nbsp;&nbsp;&nbsp; move gstmarshal.c.tmp ..\..\gst\gstmarshal.c<br>
&nbsp;&nbsp;&nbsp; echo #include "gst/gstconfig.h" &gt; gstmarshal.h.tmp<br>
&nbsp;&nbsp;&nbsp; glib-genmarshal --header --prefix=gst_marshal
..\..\gst\gstmarshal.list &gt;&gt; gstmarshal.h.tmp<br>
&nbsp;&nbsp;&nbsp; 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">&nbsp;&nbsp;&nbsp; FILE(WRITE
${CMAKE_BINARY_DIR}/gst/gstmarshal.c.template<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; "#include \"glib-object.h\"" "\n" "#include \"gstmarshal.h\""
"\n")<br>
<br>
&nbsp;&nbsp;&nbsp; ADD_CUSTOM_COMMAND(OUTPUT gstmarshal.c<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; COMMAND ${CMAKE_COMMAND} -E copy gstmarshal.c.template
gstmarshal.c<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; COMMAND glib-genmarshal --body --prefix=gst_marshal
${CMAKE_CURRENT_SOURCE_DIR}/gstmarshal.list &gt;&gt; gstmarshal.c<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/gst/<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; COMMENT "Generating flex and bison parsers" VERBATIM<br>
&nbsp;&nbsp;&nbsp; )<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 "&gt;&gt;": 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/
&amp;&amp; glib-genmarshal --body --prefix=gst_marshal
/home/alejandro/Proyectos/gstreamer/gstreamer-0.10.19/gst/gstmarshal.list
"&gt;&gt;" gstmarshal.c</font><br>
<font face="Courier New, Courier, monospace"><br>
</font>Cmake coutes &gt;&gt; operator, so no redirecting is done.<br>
<br>
Someone knows how to avoid this?<br>
<br>
</body>
</html>