<br><br><div class="gmail_quote">On Mon, May 7, 2012 at 10:37 AM, Robert Dailey <span dir="ltr">&lt;<a href="mailto:rcdailey.lists@gmail.com" target="_blank">rcdailey.lists@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">
<div class="gmail_quote"><div class="im">On Sat, May 5, 2012 at 5:34 AM, Michael Wild <span dir="ltr">&lt;<a href="mailto:themiwi@gmail.com" target="_blank">themiwi@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">

<div><div>On 05/04/2012 10:16 PM, Robert Dailey wrote:<br>
&gt; I&#39;m doing the following:<br>
&gt;<br>
&gt; set_property( TARGET ${target_name} APPEND_STRING PROPERTY<br>
&gt; COMPILE_FLAGS &quot;/ZI /Gy &quot;<br>
&gt; )<br>
&gt;<br>
&gt; However this applies to all configurations. I want to only set this<br>
&gt; compiler flag for debug builds, not release. How can I do this?<br>
&gt;<br>
<br>
</div></div>Can you misuse the COMPILE_DEFINITIONS_DEBUG property? Should work, IMHO.</blockquote><div><br></div></div><div>I can try it as a hack/workaround, but I would prefer to use the &quot;right tool for the job&quot;. Perhaps this would make a good feature request. I definitely need this to work for Visual Studio, so I can&#39;t assume the build configuration is known at generation time in CMake. </div>
</div></blockquote><div><br></div><div>I just tried your workaround and it does not work. It places everything in my preprocessor definitions field, not actually on the command line.</div><div><br></div><div>I&#39;m going to desperately need configuration-aware COMPILE_FLAGS, because in Visual Studio, I have cache variables that enable certain features, like edit &amp; continue, minimal rebuild, etc... features that are not compatible with /O2 (optimizations on). Since CMake has no choice but to enable these MSVC features in all configurations, my release builds don&#39;t work, and the user will be required to disable these features via cache variable every time they want to build release, which is unnecessary.</div>
<div><br></div><div>If no one has the bandwidth to take up this feature I suppose I could look into it. Anyone have any tips on how to implement this before I dive into the CMake code? </div></div><br>