<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
It's works. Thanks :)<br>
I don't agree using no VERBATIM option, but it wouldn't be the first
hack in computer science, hehehe.<br>
<br>
Support of cross-platform stdout redirecting would be a great feature
in future versions of cmake. Maybe implementing all options of
EXECUTE_PROCESS in ADD_CUSTOM_COMMAND.<br>
<br>
Eric Noulard escribió:
<blockquote
cite="mid:cbe23c50804210412w4144885sbdae98c074c6f354@mail.gmail.com"
type="cite">
<pre wrap="">2008/4/21, Alejandro Morell Garcí­a <a class="moz-txt-link-rfc2396E" href="mailto:alejandro.morell@gmail.com"><alejandro.morell@gmail.com></a>:
</pre>
<blockquote type="cite">
<pre wrap=""> I'm trying to convert the following script into CMake add_custom_command:
echo #include "glib-object.h" > gstmarshal.c.tmp
echo #include "gstmarshal.h" >> gstmarshal.c.tmp
glib-genmarshal --body --prefix=gst_marshal ..\..\gst\gstmarshal.list
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">gstmarshal.c.tmp
</pre>
</blockquote>
</blockquote>
<pre wrap=""> move gstmarshal.c.tmp ..\..\gst\gstmarshal.c
echo #include "gst/gstconfig.h" > gstmarshal.h.tmp
glib-genmarshal --header --prefix=gst_marshal ..\..\gst\gstmarshal.list
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">gstmarshal.h.tmp
</pre>
</blockquote>
</blockquote>
<pre wrap=""> move gstmarshal.h.tmp ..\..\gst\gstmarshal.h
That I translated in a more simple "cmake script":
FILE(WRITE
${CMAKE_BINARY_DIR}/gst/gstmarshal.c.template
"#include \"glib-object.h\"" "\n" "#include \"gstmarshal.h\"" "\n")
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
)
If I create a linux makefile, the make fails with:
(process:11394): GLib-Genmarshal-WARNING **: failed to open ">>": No such
file or directory
and all stdout from glib-genmarshal is echoed in terminal.
Inspecting Makefile, the problem seems this (file
gst/CMakeFiles/libgstreamer.dir/build.make):
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
Cmake coutes >> operator, so no redirecting is done.
Someone knows how to avoid this?
</pre>
</blockquote>
<pre wrap=""><!---->
Did you try to remove VERBATIM option for ADD_CUSTOM_COMMAND?
I have a similar ADD_CUSTOM_COMMAND which use
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">or > redirection with no pronlem.
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->
I know that VERBATIM _should_ be used but if it works without it
it may be worth a bug report.
However which version of CMake do you use?
</pre>
</blockquote>
<br>
</body>
</html>