<div dir="ltr">Dear CMake list,<br><br>I am trying to get a code generating tool chain 
to work in a cmake based build system with the Unix Makefiles generator 
and cmake 2.8.12. Look at the following MWE of what I am doing:<br><br>add_custom_command(OUTPUT generated.hh<br>                   COMMAND <somecommand><br>                   DEPENDS sourcefile)<br><br>configure_file(StandardMain.cmake main.cc)<br><div><br>add_executable(target main.cc generated.hh)<br><br>generated.hh
 is generated by a complex command from sourcefile. main.cc is generated
 from a template to include the header generated.hh. I can run "make 
target" and everything works very nicely: both main.cc and generated.hh 
are generated and the target is built. <br><br>However, when I touch 
sourcefile and run make again, generated.hh is refreshed but the target 
is not rebuilt although generated.hh has been specified a source.<br><br>I am looking forward to all your helpful responses!! Thanks!<br><br>Dominic Kempf</div></div>