You should be able to configure a file into your binary directory that references all the option variables of interest and then make a dependency on that file for your add_custom_command.<br><br><div>That way, the file will change only if one of the options changes in cmake and the dependency on it should trigger a re-run of the custom command...</div>
<div><br></div><div>Have you tried that?</div><div><br></div><div><br></div><div>HTH,</div><div>David</div><div><br></div><div><br></div><div><br><div class="gmail_quote">On Tue, Oct 28, 2008 at 3:45 PM, James Bigler <span dir="ltr">&lt;<a href="mailto:jamesbigler@gmail.com">jamesbigler@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I have a project that makes use of a add_custom_command that generates some cpp files from a given input file.&nbsp; The command can have different arguments depending on some CMake OPTION variables.<br>
<br>If I change the option variables from the CMake GUI, configure and regenerate the Visual Studio projects, are the add_custom_commands supposed to be run again?&nbsp; Currently they are not.<br>
<br>I would argue that the add_custom_command should be rerun if any of the commands change via editing the CMakeLists.txt file or by a configuration modification.<br><br>Has anyone come up with a mechanism to work around this issue?<br>

<br>CMake: 2.6.2<br>VS 2005 (32/64 bit)<br>WinXP 64<br><br>Thanks,<br><font color="#888888">James<br>
</font><br>_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake@cmake.org">CMake@cmake.org</a><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>