<div dir="ltr">Figured out the answer on my own. The problem was how I was specifying the file names on the depends. Once I added the directory to the output file and used the directory on subsequent dependencies, this started working the way I expected. <div>
<br></div><div>Rick</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 8, 2014 at 5:39 PM, Rick McGuire <span dir="ltr"><<a href="mailto:object.rexx@gmail.com" target="_blank">object.rexx@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">There's something I'm not understanding about custom commands. I have need to run a couple of custom commands during our build that generated some output files. They are specified like this: <div>
<br>
</div><div><div style="font-family:'Bitstream Vera Sans Mono';font-size:11pt;color:rgb(0,0,0)">
<pre># Build the rexx.img file
add_custom_command(OUTPUT rexx.img
COMMAND ./rexximage
DEPENDS rexximage rxapi rexxutil ${image_class_files} ${platform_rexx_img_depends}
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
add_custom_target(rexx_img ALL DEPENDS rexx.img)
</pre><pre><br></pre><pre>It produces one output file that other targets have a dependency on and it has dependencies on several files and several other targets. This is working fine with everything occurring in the proper order, but I'm a bit surprised to see this command getting run unconditionally even if none of the command dependencies have changed. Not a big issue, but the fact the output file gets updated means all of the subsequent build stages that have a dependency on the rexx.img file also get activated. Why is this happening and is there anything I can do to stop this from being generated unconditionally?</pre>
<span class="HOEnZb"><font color="#888888">
<pre><br></pre><pre>Rick</pre></font></span></div></div></div>
</blockquote></div><br></div>