<div dir="ltr">Thanks Stefan, this worked well.<br><br>My exact usage using your recommendations was as follows:<br><br>if(WIN32)<br>&nbsp;&nbsp;&nbsp; set_target_properties(WindowApplicationExample PROPERTIES LINK_FLAGS_DEBUG &quot;/SUBSYSTEM:CONSOLE&quot;)<br>
&nbsp;&nbsp;&nbsp; set_target_properties(WindowApplicationExample PROPERTIES RELWITHDEBINFO &quot;/SUBSYSTEM:CONSOLE&quot;)<br>&nbsp;&nbsp;&nbsp; set_target_properties(WindowApplicationExample PROPERTIES LINK_FLAGS_RELEASE &quot;/SUBSYSTEM:WINDOWS&quot;)<br>
&nbsp;&nbsp;&nbsp; set_target_properties(WindowApplicationExample PROPERTIES MINSIZEREL &quot;/SUBSYSTEM:WINDOWS&quot;)<br>endif(WIN32)<br><br>This allows per-config setting of weather or not to use a console in visual studio, although it does not change the actual Subsytem  setting in the Linker section, it does add it to the Additional Options setting in the Command Line section, which is then appended to the list of these settings and produces the same result.<br>
<br>Thanks for the help!<br><br>Jason<br><br><div class="gmail_quote">On Mon, Oct 6, 2008 at 10:49 AM, Stefan Buschmann <span dir="ltr">&lt;<a href="mailto:s_buschmann@gmx.de">s_buschmann@gmx.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Jason Eubank schrieb:<div class="Ih2E3d"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br>
<br>
I am wondering if it is possible to set the target property &#39;WIN32_EXECUTABLE&#39; on a per-config basis (i.e. you can set link-flags on a per-config basis using LINK_FLAGS_&lt;Config&gt;). From reading the documentation this does not seem possible and if you set this property then all configurations (in Visual Studio) use the same subsystem setting.<br>

</blockquote></div>
I don&#39;t know whether or not CMake is able to set a property on a per-configuration basis. I doubt this is possible (yet), but could be that I&#39;m wrong here.<br>
<br>
But you could simply set the appropriate flags for a console/win32 application yourself, without using this flag at all. The only differences I could find between a win32 application and a console application are<br>
- Linker flag: &quot;/SUBSYSTEM:CONSOLE&quot; for console apps and &quot;/SUBSYSTEM:WINDOWS&quot; for win32 apps<br>
- Preprocessor definition: &#39;_CONSOLE&#39; for console apps<br>
<br>
Setting these using LINK_FLAGS_&lt;Config&gt; and COMPILE_DEFINITIONS_&lt;Config&gt; should do exactly what you want. The only problem I see that could possibly arise is that you can&#39;t depend on the WIN32_EXECUTABLE flag in your CMake file(s) anymore, to test for it or use it in any other way later.<br>

<br>
Another solution that comes to my mind is to always create a win32 application, and then open a console window later by using the win32 function &#39;AllocConsole&#39; in your code. I never really needed this, but I know those functions are there to create or attach a console window to a win32 application. Have a look at the documentation for this function.<br>

<br>
Stefan<br>
<br>
_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake@cmake.org" target="_blank">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>