Re: [CMake] Run custom command only when dependency changes

2014-04-01 Thread Lloyd
On Tue, Apr 1, 2014 at 12:55 PM, Nils Gladitz wrote: > SET (MY_SRC Event_log.h other.cpp other1.cpp) >> >> ADD_EXECUTABLE(MyExe ${MY_SRC } >> >> add_custom_command(OUTPUT Event_log.h COMMAND mc Event_log.mc >> WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS Event_log.mc) >> >> Whenever I ru

Re: [CMake] Run custom command only when dependency changes

2014-04-01 Thread Nils Gladitz
SET (MY_SRC Event_log.h other.cpp other1.cpp) ADD_EXECUTABLE(MyExe ${MY_SRC } add_custom_command(OUTPUT Event_log.h COMMAND mc Event_log.mc WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS Event_log.mc) Whenever I run the build command, this causes the "mc" to rerun each time (even if the

[CMake] Run custom command only when dependency changes

2014-03-31 Thread Lloyd
Hi, I am using visual studio. We are using "visual studio message compiler" which compiles a ".mc" file and generate ".rc and .h" files as output. Our project has a dependency on this ".h" file. What we want is to invoke "message compiler" whenever the ".mc" file changes. To achieve this I have u