<font size=2 face="Arial">I have a program that uses the Window's Event
Log. Using the event log is a little goofy; it requires a message resource
file. So I set up a custom command to call mc.exe can create a header and
resource file from a message script (*.mc file). This generally works fine,
but sometimes it says it can't find the *.rc file. This happens sporadically.
I checked via GET_SOURCE_FILE_PROPERTY that the *.rc file is marked as
generated. Is this familiar to anyone? I was wondering if Windows was playing
a trick on me or something.</font>
<br>
<br><font size=2>ADD_CUSTOM_COMMAND(</font>
<br><font size=2> OUTPUT </font>
<br><font size=2> </font><font size=2 color=#a11f12>"${PROJECT_BINARY_DIR}/event_log_messages.h"</font>
<br><font size=2> </font><font size=2 color=#a11f12>"${PROJECT_BINARY_DIR}/event_log_messages.rc"</font>
<br><font size=2> COMMAND mc -c</font>
<br><font size=2> -U </font><font size=2 color=#a11f12>"${PROJECT_SOURCE_DIR}/event_log_messages.mc"</font><font size=2>
</font>
<br><font size=2> -r </font><font size=2 color=#a11f12>"${PROJECT_BINARY_DIR}"</font>
<br><font size=2> -h </font><font size=2 color=#a11f12>"${PROJECT_BINARY_DIR}"</font>
<br><font size=2> DEPENDS </font><font size=2 color=#a11f12>"${PROJECT_SOURCE_DIR}/event_log_messages.mc"</font>
<br><font size=2> COMMENT </font><font size=2 color=#a11f12>"Generating
\"event_log_messages.h\" & \"event_log_messages.rc\""</font><font size=2>)</font>
<br><font size=2> </font>
<br><font size=2>SET(</font>
<br><font size=2> SOURCES </font>
<br><font size=2> </font><font size=2 color=#a11f12>"${PROJECT_SOURCE_DIR}/main.cpp"</font>
<br><font size=2> </font><font size=2 color=#a11f12>"${PROJECT_SOURCE_DIR}/event_log_messages.mc"</font>
<br><font size=2> </font><font size=2 color=#a11f12>"${PROJECT_BINARY_DIR}/event_log_messages.rc"</font><font size=2>)</font>
<br><font size=2> </font>
<br><font size=2>SET(</font>
<br><font size=2> HEADERS </font>
<br><font size=2> </font><font size=2 color=#a11f12>"${PROJECT_BINARY_DIR}/event_log_messages.h"</font><font size=2>)</font>
<br>
<br><font size=2>ADD_EXECUTABLE(</font>
<br><font size=2> event_log_test</font>
<br><font size=2> SOURCES ${SOURCES}</font>
<br><font size=2> HEADERS ${HEADERS})</font>
<br>
<br><font size=2 face="Arial">-------------------------------------------------------------<br>
Aaron Wright</font>