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.
ADD_CUSTOM_COMMAND(
OUTPUT
"${PROJECT_BINARY_DIR}/event_log_messages.h"
"${PROJECT_BINARY_DIR}/event_log_messages.rc"
COMMAND mc -c
-U "${PROJECT_SOURCE_DIR}/event_log_messages.mc"
-r "${PROJECT_BINARY_DIR}"
-h "${PROJECT_BINARY_DIR}"
DEPENDS "${PROJECT_SOURCE_DIR}/event_log_messages.mc"
COMMENT "Generating \"event_log_messages.h\" &
\"event_log_messages.rc\"")
SET(
SOURCES
"${PROJECT_SOURCE_DIR}/main.cpp"
"${PROJECT_SOURCE_DIR}/event_log_messages.mc"
"${PROJECT_BINARY_DIR}/event_log_messages.rc")
SET(
HEADERS
"${PROJECT_BINARY_DIR}/event_log_messages.h")
ADD_EXECUTABLE(
event_log_test
SOURCES ${SOURCES}
HEADERS ${HEADERS})
-------------------------------------------------------------
Aaron Wright
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake