Does the behavior change if you list the rc file first? Or if you list only the rc file as an OUTPUT?<div><br></div><div>I vaguely remember there being some difference between &quot;primary&quot; OUTPUT and other files mentioned as OUTPUT values, but it&#39;s in the foggy past... Some experimentation or some reading of the add_custom_command source code is in order.</div>
<div><br></div><div><br></div><div>Let me know if this helps,</div><div>David</div><div><br><br><div class="gmail_quote">On Fri, Jul 23, 2010 at 4:12 PM,  <span dir="ltr">&lt;<a href="mailto:Aaron_Wright@selinc.com">Aaron_Wright@selinc.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">(This is a repeat email, but my last one may have been in reply to another<br>
message, which it should not have been. So I&#39;m trying again, sorry.)<br>
<br>
I have a program that uses the Window&#39;s Event Log. Using the event log is<br>
a little goofy; it requires a message resource file. So I set up a custom<br>
command to call mc.exe can create a header and resource file from a<br>
message script (*.mc file). This configures ok, but fails during<br>
generation. It says it can&#39;t find the *.rc file. I checked via<br>
GET_SOURCE_FILE_PROPERTY that the *.rc file is marked as generated.<br>
<br>
Is this familiar to anyone? I was wondering if Windows was playing a trick<br>
on me or something, and is there a way to work around it? I currently have<br>
to go and create the *.rc file by hand, and re-run CMake. This man-made<br>
*.rc file is then overwritten during building like normal.<br>
<br>
ADD_CUSTOM_COMMAND(<br>
   OUTPUT<br>
      &quot;${PROJECT_BINARY_DIR}/event_log_messages.h&quot;<br>
      &quot;${PROJECT_BINARY_DIR}/event_log_messages.rc&quot;<br>
   COMMAND mc -c<br>
      -U &quot;${PROJECT_SOURCE_DIR}/<a href="http://event_log_messages.mc" target="_blank">event_log_messages.mc</a>&quot;<br>
      -r &quot;${PROJECT_BINARY_DIR}&quot;<br>
      -h &quot;${PROJECT_BINARY_DIR}&quot;<br>
   DEPENDS &quot;${PROJECT_SOURCE_DIR}/<a href="http://event_log_messages.mc" target="_blank">event_log_messages.mc</a>&quot;<br>
   COMMENT &quot;Generating \&quot;event_log_messages.h\&quot; &amp;<br>
\&quot;event_log_messages.rc\&quot;&quot;)<br>
<br>
SET(<br>
   SOURCES<br>
   &quot;${PROJECT_SOURCE_DIR}/main.cpp&quot;<br>
   &quot;${PROJECT_SOURCE_DIR}/<a href="http://event_log_messages.mc" target="_blank">event_log_messages.mc</a>&quot;<br>
   &quot;${PROJECT_BINARY_DIR}/event_log_messages.rc&quot;)<br>
<br>
SET(<br>
   HEADERS<br>
   &quot;${PROJECT_BINARY_DIR}/event_log_messages.h&quot;)<br>
<br>
ADD_EXECUTABLE(<br>
   event_log_test<br>
   SOURCES ${SOURCES}<br>
   HEADERS ${HEADERS})<br>
<br>
---<br>
Aaron Wright<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br></div>