On Fri, Nov 27, 2009 at 5:28 PM, Steven Wilson <span dir="ltr">&lt;<a href="mailto:steven.wesley.wilson@gmail.com">steven.wesley.wilson@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

The current CMake 2.8.0 system does not allow custom commands created
with add_custom_command() to do different things based on the build
configuration.<br>
<br>
I propose adding a new keyword to the add_custom_command CMake directive called CONFIG:<br>
<br>
add_custom_command(OUTPUT output1 [output2 ...]<br>
   COMMAND command1 [ARGS] [args1...]<br>
   [COMMAND command2 [ARGS] [args2...] ...]<br>
   [MAIN_DEPENDENCY depend]<br>
   [DEPENDS [depends...]]<br>
   [IMPLICIT_DEPENDS &lt;lang1&gt; depend1 ...]<br>
   [WORKING_DIRECTORY dir]<br>
   [COMMENT comment] [VERBATIM] [APPEND]<br>
   [CONFIG Debug | MinSizeRel | Release | RelWithDebInfo | ...])<br>
<br>
add_custom_command(TARGET target<br>
   PRE_BUILD | PRE_LINK | POST_BUILD<br>
   COMMAND command1 [ARGS] [args1...]<br>
   [COMMAND command2 [ARGS] [args2...] ...]<br>
   [WORKING_DIRECTORY dir]<br>
   [COMMENT comment] [VERBATIM]<br>
   [CONFIG Debug | MinSizeRel | Release | RelWithDebInfo | ...])<br>
<br>
The CONFIG option specifies that the custom command(s) should run only
when the given build configuration is active. This option allows custom
commands to have configuration specific behavior.<br>
<br>
When the CONFIG option is not present, add_custom_command behaves as before.<br><br>I have reported this issue(9974) in the Mantis database and provided patches that implement this change.  <br><br>Thanks,<br><br>Steve<br>



<br></blockquote></div><br>That would be a welcome feature.  I&#39;ve gotten around this issue, by generating a build time invoked script that takes the configuration as a parameter and behaves differently based on the value.<br>

<br>James<br>