<br><font size=2 face="sans-serif">foreach(in_file ${ARGN})</font>
<br>
<br><font size=2 face="sans-serif">....</font>
<br>
<br><font size=2 face="sans-serif">ADD_CUSTOM_COMMAND(</font>
<br><font size=2 face="sans-serif"> OUTPUT
${IDL_OUTPUT_DIR}/${out_file}.h</font>
<br><font size=2 face="sans-serif">
${IDL_OUTPUT_DIR}/${out_file}.tlb</font>
<br><font size=2 face="sans-serif"> DEPENDS
${in_file}</font>
<br><font size=2 face="sans-serif"> COMMAND(${MIDL_EXECUTABLE}
${in_file} <insert other args here></font>
<br><font size=2 face="sans-serif"> WORKING_DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}</font>
<br><font size=2 face="sans-serif">)</font>
<br>
<br><font size=2 face="sans-serif">....</font>
<br>
<br><font size=2 face="sans-serif">endforeach()</font>
<br>
<br><font size=2 face="sans-serif">i'm using this to generate files from
IDL files so i can neatly list them</font>
<br><font size=2 face="sans-serif">and because there is no way to set the
working directory for the midl tool in cmake</font>
<br>
<br><font size=2 face="sans-serif">I didn't put the rest of the file here
because it's on another computer and i had to copy this by writing it.</font>
<br>
<br><font size=2 face="sans-serif">from what i read in the "Mastering
CMake" book, the DEPENDS thing should work.</font>
<br>
<br><font size=2 face="sans-serif">I'v had 2 variations to the value, with
absolute path and with relative, neither work.</font>
<br>
<br><font size=2 face="sans-serif">I checked that they were correct by
writing the value out with the 'message' command and by testing the path
printed out.</font>
<br>
<br><font size=2 face="sans-serif">Did i miss something?</font>
<br>
<br><font size=2 face="sans-serif">-mika</font>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>"Rolf Eike Beer"
<eike@sf-mail.de></b> </font>
<br><font size=1 face="sans-serif">Sent by: cmake-bounces@cmake.org</font>
<p><font size=1 face="sans-serif">08.03.2011 12:53</font>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">cmake@cmake.org</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">Re: [CMake] Run/build custom command/target
only when "input" files change</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2><tt>> Hi<br>
><br>
> I have created a custom command that generates source code for me.<br>
><br>
> There is a slight annoyance still, the command is excecuted every
single<br>
> time i tell the compiler to build.<br>
><br>
> Can I make it so that it runs the program only when the source file<br>
> changes or the target file doesn't exist?<br>
><br>
> I looked at the documentation for add_custom_command and add_custom_target<br>
> but found no direct anwser from either.<br>
><br>
> I tried using dependencies but nothing came out of that for me.<br>
<br>
Then show us some code on how you defined that command.<br>
<br>
Eike<br>
_______________________________________________<br>
Powered by www.kitware.com<br>
<br>
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html<br>
<br>
Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ<br>
<br>
Follow this link to subscribe/unsubscribe:<br>
http://www.cmake.org/mailman/listinfo/cmake<br>
</tt></font>
<br>